Last active
May 18, 2017 04:53
-
-
Save ashrithr/5905421 to your computer and use it in GitHub Desktop.
Revisions
-
ashrithr revised this gist
Jul 1, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,4 @@ def undent ..another line EOS puts test.inspect # => "testing unindent\nanother line\n" -
ashrithr created this gist
Jul 1, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ class String def undent gsub(/^.{#{slice(/^ +/).length}}/, '') end end #Usage: test = <<-EOS.undent testing unindent ..another line EOS puts test.inspect