aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os
diff options
context:
space:
mode:
authorBaptiste Fontaine2016-01-14 13:57:18 +0100
committerBaptiste Fontaine2016-01-19 14:00:01 +0100
commit92a71a534f9aa956eecc7ebeac0bd5dbe0ca980f (patch)
tree9437a65280abad8b746549de3bdee17607bd628f /Library/Homebrew/os
parent7faae5adf281927c5f4c86029d9e67a6c9f4324e (diff)
downloadbrew-92a71a534f9aa956eecc7ebeac0bd5dbe0ca980f.tar.bz2
os/mac: use start_with? when possible
Closes Homebrew/homebrew#48071. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew/os')
-rw-r--r--Library/Homebrew/os/mac.rb4
-rw-r--r--Library/Homebrew/os/mac/xcode.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb
index 0af37578d..946c2576c 100644
--- a/Library/Homebrew/os/mac.rb
+++ b/Library/Homebrew/os/mac.rb
@@ -141,7 +141,7 @@ module OS
@gcc_42_build_version ||=
begin
gcc = MacOS.locate("gcc-4.2") || HOMEBREW_PREFIX.join("opt/apple-gcc42/bin/gcc-4.2")
- if gcc.exist? && gcc.realpath.basename.to_s !~ /^llvm/
+ if gcc.exist? && !gcc.realpath.basename.to_s.start_with?("llvm")
`#{gcc} --version`[/build (\d{4,})/, 1].to_i
end
end
@@ -150,7 +150,7 @@ module OS
def llvm_build_version
@llvm_build_version ||=
- if (path = locate("llvm-gcc")) && path.realpath.basename.to_s !~ /^clang/
+ if (path = locate("llvm-gcc")) && !path.realpath.basename.to_s.start_with?("clang")
`#{path} --version`[/LLVM build (\d{4,})/, 1].to_i
end
end
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index 3de397dcc..86213e69b 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -141,9 +141,9 @@ module OS
def default_prefix?
if version < "4.3"
- %r{^/Developer} === prefix
+ prefix.to_s.start_with? "/Developer"
else
- %r{^/Applications/Xcode.app} === prefix
+ prefix.to_s.start_with? "/Applications/Xcode.app"
end
end
end