aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-07-21 19:11:04 -0500
committerJack Nagel2013-07-22 11:25:10 -0500
commitc4e6794fad18b9967eb25fd9771fac0b28b0855c (patch)
tree40aa89b45e89b2a5c0d6ff506064766861aa5b71 /Library
parentc288e866c467531b0a1943d6a3fdd4fe4ea88610 (diff)
downloadhomebrew-c4e6794fad18b9967eb25fd9771fac0b28b0855c.tar.bz2
Extract bundle_path from XQuartz.version
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/os/mac/xquartz.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb
index a836abcbc..b4fd1ece7 100644
--- a/Library/Homebrew/os/mac/xquartz.rb
+++ b/Library/Homebrew/os/mac/xquartz.rb
@@ -8,7 +8,7 @@ module MacOS::XQuartz extend self
# by this method.
def version
@version ||= begin
- path = MacOS.app_with_bundle_id(FORGE_BUNDLE_ID) || MacOS.app_with_bundle_id(APPLE_BUNDLE_ID)
+ path = bundle_path
if not path.nil? and path.exist?
`mdls -raw -name kMDItemVersion "#{path}" 2>/dev/null`.strip
elsif prefix.to_s == "/usr/X11"
@@ -33,6 +33,10 @@ module MacOS::XQuartz extend self
"2.7.4"
end
+ def bundle_path
+ MacOS.app_with_bundle_id(FORGE_BUNDLE_ID) || MacOS.app_with_bundle_id(APPLE_BUNDLE_ID)
+ end
+
def provided_by_apple?
[FORGE_BUNDLE_ID, APPLE_BUNDLE_ID].find do |id|
MacOS.app_with_bundle_id(id)