Sha256: 578027d983b9694752dfb9395e64af90fc4e59af1492656e51e42cb3f1ac0ca9
Contents?: true
Size: 259 Bytes
Versions: 17
Compression:
Stored size: 259 Bytes
Contents
class String def undent min_space_num = self.split("\n").delete_if {|s| s =~ /^\s*$/ }.map {|s| (s[/^\s+/] || '').length }.min if min_space_num and min_space_num > 0 gsub(/^[ \t]{,#{min_space_num}}/, '') else self end end end
Version data entries
17 entries across 17 versions & 2 rubygems