Sha256: a4805ef769e666d713993f20e7718ed657cf122b523bc2c218da802358050a3d

Contents?: true

Size: 586 Bytes

Versions: 53

Compression:

Stored size: 586 Bytes

Contents

module GLI
  module Commands
    module HelpModules
      # Formats text in one line, stripping newlines and NOT wrapping
      class OneLineWrapper
        # Args are ignored entirely; this keeps it consistent with the TextWrapper interface
        def initialize(width,indent)
        end

        # 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.
        def wrap(text)
          return String(text).gsub(/\n+/,' ').strip
        end
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
gli-2.15.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.14.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.13.4 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.13.3 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.13.2 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.13.1 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.13.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.12.3 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.12.2 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.12.1 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.12.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.11.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.10.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.9.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli_aziz_light-2.8.1 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.8.1 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.8.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.7.0 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.6.2 lib/gli/commands/help_modules/one_line_wrapper.rb
gli-2.6.1 lib/gli/commands/help_modules/one_line_wrapper.rb