Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created September 8, 2012 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/3670948 to your computer and use it in GitHub Desktop.
Save havenwood/3670948 to your computer and use it in GitHub Desktop.
WordWrap from ActionPack
`gem install actionpack`
Gem.refresh
require 'action_view'
include ActionView::Helpers::TextHelper
puts word_wrap 'My life closed twice before its close; It yet remains to see If Immortality unveil A third event to me, So huge, so hopeless to conceive, As these that twice befell. Parting is all we know of heaven, And all we need of hell.', :line_width => 40
#My life closed twice before its close;
#It yet remains to see If Immortality
#unveil A third event to me, So huge, so
#hopeless to conceive, As these that
#twice befell. Parting is all we know of
#heaven, And all we need of hell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment