From cee1003782b6b38ed1aca327c996bcd426606f6b Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 13 Jun 2011 14:32:50 -0700 Subject: brew-doctor: use String.start_with? --- Library/Homebrew/cmd/doctor.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'Library') 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 -- cgit v1.2.3