ohgiri

Simple library to shorten the text by the specified length.

install

gem install ohgiri

usage

"Not that I loved Caesar less, but that I loved Rome more.".shorten(15)
# => "Not that I ..."

"All that glitters is not gold.".shorten(100)
# => "All that glitters is not gold."

"But break, my heart, for I must hold my tongue.".shorten
# => "But bre..."
# (default length is 10 chr.)

"Life's but a walking shadow.".shorten(10, '-')
# => "Life's bu-"

Contributing to ohgiri

Copyright © 2013 Jun Yokoyama. See LICENSE.txt for further details.