Sha256: d5570b49c731ff8bb71072569ba55fd82625a00de4fe68e9b9c9bc853c288258
Contents?: true
Size: 232 Bytes
Versions: 36
Compression:
Stored size: 232 Bytes
Contents
class String def unindent indent = self.split("\n").select do |line| !line.strip.empty? end.map do |line| line.index(/[^\s]/) end.compact.min || 0 self.gsub(/^[[:blank:]]{#{indent}}/, '') end end
Version data entries
36 entries across 36 versions & 1 rubygems