Method: Wpxf::Cli::Output#wrap_text
- Defined in:
- lib/wpxf/cli/output.rb
#wrap_text(value, padding = 0, width = 78) ⇒ Object
23 24 25 26 |
# File 'lib/wpxf/cli/output.rb', line 23 def wrap_text(value, padding = 0, width = 78) value.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n#{indent * indent_level}#{' ' * padding}").chomp .gsub(/\s+$/, '') end |