diff options
| author | Tim D. Smith | 2016-03-15 23:47:54 -0700 |
|---|---|---|
| committer | Xu Cheng | 2016-03-19 19:14:50 +0800 |
| commit | 87781f2a3734ad778660126fb2bc9681092f5951 (patch) | |
| tree | 12bfff0c30e6555f1e9abdd4193db982215e1a1a /Library | |
| parent | f0a5abe12e0e037ec7569b63d7169f7a0798b6c6 (diff) | |
| download | brew-87781f2a3734ad778660126fb2bc9681092f5951.tar.bz2 | |
Avoid constructing paths by string interpolation
Closes Homebrew/homebrew#50154.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/ENV/std.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV/super.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/sdk.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/xcode.rb | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 8bfc5ce57..c75bed707 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -67,8 +67,8 @@ module Stdenv macosxsdk MacOS.version if MacOS::Xcode.without_clt? - append_path "PATH", "#{MacOS::Xcode.prefix}/usr/bin" - append_path "PATH", "#{MacOS::Xcode.toolchain_path}/usr/bin" + append_path "PATH", (MacOS::Xcode.prefix/"usr/bin").to_s + append_path "PATH", (MacOS::Xcode.toolchain_path/"usr/bin").to_s end end diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index c2401602f..6fd259d81 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -119,8 +119,8 @@ module Superenv # On 10.9, there are shims for all tools in /usr/bin. # On 10.7 and 10.8 we need to add these directories ourselves. if MacOS::Xcode.without_clt? && MacOS.version <= "10.8" - paths << "#{MacOS::Xcode.prefix}/usr/bin" - paths << "#{MacOS::Xcode.toolchain_path}/usr/bin" + paths << (MacOS::Xcode.prefix/"usr/bin").to_s + paths << (MacOS::Xcode.toolchain_path/"usr/bin").to_s end paths << MacOS::X11.bin.to_s if x11? diff --git a/Library/Homebrew/os/mac/sdk.rb b/Library/Homebrew/os/mac/sdk.rb index 8ba5f4329..01e4170ac 100644 --- a/Library/Homebrew/os/mac/sdk.rb +++ b/Library/Homebrew/os/mac/sdk.rb @@ -33,7 +33,7 @@ module OS def sdk_paths @sdk_paths ||= begin # Xcode.prefix is pretty smart, so let's look inside to find the sdk - sdk_prefix = "#{Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs" + sdk_prefix = (Xcode.prefix/"Platforms/MacOSX.platform/Developer/SDKs").to_s # Xcode < 4.3 style sdk_prefix = "/Developer/SDKs" unless File.directory? sdk_prefix # Finally query Xcode itself (this is slow, so check it last) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index b951b1232..31b6d227d 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -50,7 +50,7 @@ module OS end def toolchain_path - Pathname.new("#{prefix}/Toolchains/XcodeDefault.xctoolchain") if installed? && version >= "4.3" + (prefix/"Toolchains/XcodeDefault.xctoolchain") if installed? && version >= "4.3" end # Ask Spotlight where Xcode is. If the user didn't install the @@ -79,8 +79,8 @@ module OS return nil if !MacOS::Xcode.installed? && !MacOS::CLT.installed? - %W[#{prefix}/usr/bin/xcodebuild #{which("xcodebuild")}].uniq.each do |path| - if File.file? path + [(prefix/"usr/bin/xcodebuild"), which("xcodebuild")].uniq.each do |path| + if path.file? Utils.popen_read(path, "-version") =~ /Xcode (\d(\.\d)*)/ return $1 if $1 end |
