aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/extend/string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb
index 57630a701..0246f0c90 100644
--- a/Library/Homebrew/extend/string.rb
+++ b/Library/Homebrew/extend/string.rb
@@ -2,6 +2,13 @@ class String
def undent
gsub(/^.{#{slice(/^ +/).length}}/, '')
end
+
+ unless String.method_defined?(:start_with?)
+ def start_with? prefix
+ prefix = prefix.to_s
+ self[0, prefix.length] == prefix
+ end
+ end
end
# used by the inreplace function (in utils.rb)