aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-10-04 12:43:30 -0500
committerJack Nagel2013-10-04 12:44:05 -0500
commit7bb90c992a511b61342c8c94152a0a2e49527629 (patch)
tree44b591192df4752b3e482b3c27137b6b010efe2d /Library
parente887232b7ec991e451e7dfc7ee23d6d91c023958 (diff)
downloadbrew-7bb90c992a511b61342c8c94152a0a2e49527629.tar.bz2
Fetch yields the key, use it
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/macos.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb
index 7d9f2e4a0..19cbbe421 100644
--- a/Library/Homebrew/macos.rb
+++ b/Library/Homebrew/macos.rb
@@ -17,8 +17,8 @@ module MacOS extend self
# Don't call tools (cc, make, strip, etc.) directly!
# Give the name of the binary you look for as a string to this method
# in order to get the full path back as a Pathname.
- (@locate ||= {}).fetch(tool.to_s) do
- @locate[tool.to_s] = if File.executable?(path = "/usr/bin/#{tool}")
+ (@locate ||= {}).fetch(tool.to_s) do |key|
+ @locate[key] = if File.executable?(path = "/usr/bin/#{tool}")
Pathname.new path
# Homebrew GCCs most frequently; much faster to check this before xcrun
# This also needs to be queried if xcrun won't work, e.g. CLT-only
@@ -76,7 +76,7 @@ module MacOS extend self
end
def sdk_path(v = version)
- (@sdk_path ||= {}).fetch(v.to_s) do
+ (@sdk_path ||= {}).fetch(v.to_s) do |key|
opts = []
# First query Xcode itself
opts << `#{locate('xcodebuild')} -version -sdk macosx#{v} Path 2>/dev/null`.chomp unless Xcode.bad_xcode_select_path?
@@ -84,7 +84,7 @@ module MacOS extend self
opts << "#{Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{v}.sdk"
# Xcode < 4.3 style
opts << "/Developer/SDKs/MacOSX#{v}.sdk"
- @sdk_path[v.to_s] = opts.map { |a| Pathname.new(a) }.detect(&:directory?)
+ @sdk_path[key] = opts.map { |a| Pathname.new(a) }.detect(&:directory?)
end
end
@@ -250,14 +250,14 @@ module MacOS extend self
def mdfind id
return [] unless MACOS
- (@mdfind ||= {}).fetch(id.to_s) do
- @mdfind[id.to_s] = `/usr/bin/mdfind "kMDItemCFBundleIdentifier == '#{id}'"`.split("\n")
+ (@mdfind ||= {}).fetch(id.to_s) do |key|
+ @mdfind[key] = `/usr/bin/mdfind "kMDItemCFBundleIdentifier == '#{key}'"`.split("\n")
end
end
def pkgutil_info id
- (@pkginfo ||= {}).fetch(id.to_s) do
- @pkginfo[id.to_s] = `/usr/sbin/pkgutil --pkg-info "#{id}" 2>/dev/null`.strip
+ (@pkginfo ||= {}).fetch(id.to_s) do |key|
+ @pkginfo[key] = `/usr/sbin/pkgutil --pkg-info "#{key}" 2>/dev/null`.strip
end
end
end