class GLI::Commands::HelpModules::OneLineWrapper
Formats text in one line, stripping newlines and NOT wrapping
Public Class Methods
new(width,indent)
click to toggle source
Args are ignored entirely; this keeps it consistent with the TextWrapper interface
# File lib/gli/commands/help_modules/one_line_wrapper.rb, line 7 def initialize(width,indent) end
Public Instance Methods
wrap(text)
click to toggle source
Return a wrapped version of text, assuming that the first line has already been indented by @indent characters. Resulting text does NOT have a newline in it.
# File lib/gli/commands/help_modules/one_line_wrapper.rb, line 12 def wrap(text) return String(text).gsub(/\n+/,' ').strip end