aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/string.rb
diff options
context:
space:
mode:
authorWilliam Woodruff2015-08-26 16:50:36 -0400
committerXu Cheng2015-08-28 18:02:04 +0800
commitb0d5e17906229e95f2bc548e4b607297e7e907ab (patch)
tree2a4b4d4a73bed5eef958230503accb0120b99785 /Library/Homebrew/extend/string.rb
parent3b88c070c616788492aebdef2702d584fe3527b6 (diff)
downloadbrew-b0d5e17906229e95f2bc548e4b607297e7e907ab.tar.bz2
tweak String#undent so that only leading whitespace up to the first indentation level is gsubbed, change test_undent to reflect change and add test_undent_nested to test new behavior
Diffstat (limited to 'Library/Homebrew/extend/string.rb')
-rw-r--r--Library/Homebrew/extend/string.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb
index fc507e151..632d8ae8a 100644
--- a/Library/Homebrew/extend/string.rb
+++ b/Library/Homebrew/extend/string.rb
@@ -1,6 +1,6 @@
class String
def undent
- gsub(/^.{#{(slice(/^ +/) || '').length}}/, "")
+ gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "")
end
# eg: