aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2010-08-08 09:13:27 -0700
committerAdam Vandenberg2010-08-08 09:13:27 -0700
commit013fe4bf38d0ae950fe6a14e8b70ee74370fc3eb (patch)
tree796135684aca8e5573d277d26c2da7a51c09398b /Library/Homebrew/extend/pathname.rb
parenteca31da253471f2f8fc2893e35281aa0c7a357ed (diff)
downloadbrew-013fe4bf38d0ae950fe6a14e8b70ee74370fc3eb.tar.bz2
Move Pathname.starts_with? into Pathname
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-rw-r--r--Library/Homebrew/extend/pathname.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 93a1f08cc..cb06688d7 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -203,6 +203,11 @@ class Pathname
def resolved_path_exists?
(dirname+readlink).exist?
end
+
+ def starts_with? prefix
+ prefix = prefix.to_s
+ self.to_s[0, prefix.length] == prefix
+ end
end
# sets $n and $d so you can observe creation of stuff