aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2011-06-13 14:32:50 -0700
committerAdam Vandenberg2011-06-19 21:32:54 -0700
commitdbba2dfa4168eb8f22131a513ba59a333e51ce48 (patch)
tree2b96e8905d3110848a8b69f74b41f44dbaa9df53 /Library
parent75760b24e733b918549ad357a90d712dda03336f (diff)
downloadhomebrew-dbba2dfa4168eb8f22131a513ba59a333e51ce48.tar.bz2
brew-doctor: use String.start_with?
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 9374d19aa..1d56da375 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -17,7 +17,7 @@ class Volumes
def which path
@volumes.each_index do |i|
vol = @volumes[i]
- return i if is_prefix?(vol[1], path)
+ return i if vol[1].start_with? path.to_s
end
return -1
@@ -25,12 +25,6 @@ class Volumes
end
-def is_prefix? prefix, longer_string
- p = prefix.to_s
- longer_string.to_s[0,p.length] == p
-end
-
-
def remove_trailing_slash s
(s[s.length-1] == '/') ? s[0,s.length-1] : s
end