Summarise
Summarise is a small gem which extends String, allowing you to create summaries of strings while respecting word boundaries.
Usage
str = "Summarise is a small gem which extends String, allowing you to create summaries."
str.summarise 25
=> "Summarise is a small gem which"
str.summarise 25, :suffix => "..."
=> "Summarise is a small gem which..."
str.summarise 5000, :suffix => "..."
=> "Summarise is a small gem which extends String, allowing you to create summaries."
Installation
Add this line to your application's Gemfile:
gem 'summarise'
And then execute:
$ bundle
Or install it yourself as:
$ gem install summarise
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request