Project

ChunkyText

0.0
No commit activity in last 3 years
No release in over 3 years
Break up a long string of text into nicely formated 140 character strings for Twitter and keping links and punctuation intact.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
>= 0
>= 0
~> 10.0
>= 0
 Project Readme

Build Status Gem Version Coverage Status

ChunkyText

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'ChunkyText'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ChunkyText

Usage

You have a given string. Example:

string = "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?

Initialize the ChunkyText object with the string and a max length

text = ChunkyText::Chunker.new(string, 140)

Call .chunk_array on the object and get an array back.

  text.chunk_array #=> ["Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, ... , ... , ...]

Contributing

  1. Fork it ( https://github.com/[my-github-username]/ChunkyText/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request