Sha256: fb936f251cfb064a8df4f223fb4118d0bfff3e8fb9ba7049f8cd91f34f91b523
Contents?: true
Size: 290 Bytes
Versions: 13
Compression:
Stored size: 290 Bytes
Contents
class ::String # Trim beginning of each line by the amount of indentation in the first line def align_left str = self.sub(/^\s*$/, '') # Remove leading newline str = str[1..-1] if str[0,1] == "\n" ws = str.match(/^(\s*)\S/m) ? $1 : '' str.gsub(/^#{ws}/m, '') end end
Version data entries
13 entries across 13 versions & 1 rubygems