Skip to content
Snippets Groups Projects
Commit e6bac8a8 authored by Adam Vandenberg's avatar Adam Vandenberg
Browse files

back-port start_with? from 1.8.7

This allows its use in Leopard, which has Ruby 1.8.6.
parent 0d44609d
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment