Sha256: 40b38525425ef298889cdf5f5c14ec54930bef79eb7acb91e1c165b5df53d6c8

Contents?: true

Size: 257 Bytes

Versions: 2

Compression:

Stored size: 257 Bytes

Contents

class String
  # Strip leading whitespace from each line that is the same as the 
  # amount of whitespace on the first line of the string.
  # Leaves _additional_ indentation on later lines intact.
  def unindent
    gsub /^#{self[/\A\s*/]}/, ''
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
Birst_Command-0.5.0 lib/birst_command/core_additions.rb
Birst_Command-0.4.0 lib/birst_command/core_additions.rb