Move Pathname.starts_with? into Pathname
This commit is contained in:
parent
eca31da253
commit
013fe4bf38
@ -3,19 +3,12 @@ require 'extend/pathname'
|
||||
REAL_CELLAR = HOMEBREW_CELLAR.realpath
|
||||
|
||||
class String
|
||||
def starts_with?(prefix)
|
||||
def starts_with? prefix
|
||||
prefix = prefix.to_s
|
||||
self[0, prefix.length] == prefix
|
||||
end
|
||||
end
|
||||
|
||||
class Pathname
|
||||
def starts_with?(prefix)
|
||||
prefix = prefix.to_s
|
||||
self.to_s[0, prefix.length] == prefix
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def audit
|
||||
brew_links = Array.new
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user