In Files

Parent

Methods

Files

Class/Module Index [+]

Quicksearch

String

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 20
def word_wrap(line_width = 80)
  gsub(/\n/, "\n\n").gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.