Extend String with a word_wrap method, which we use in
the ERB template below. Taken with modification from the word_wrap method in ActionPack.
Text::Format does the same thing better.
Public Instance Methods
word_wrap(line_width = 80)click to toggle source
# File lib/gem2rpm5.rb, line 20defword_wrap(line_width = 80)
gsub(/\n/, "\n\n").gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").stripend