Sha256: b2a6040d06eb80b5792a1e6665934134c256656ea2c0b499e453d5bb23d3349d
Contents?: true
Size: 289 Bytes
Versions: 50
Compression:
Stored size: 289 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
50 entries across 50 versions & 1 rubygems