aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-07-21 19:11:04 -0500
committerJack Nagel2013-07-22 11:25:10 -0500
commitdf0d4aa8530da406f8e58ee5e6d757acca1045de (patch)
tree343438102cd8c79f73a1fe4df685d974fb710621
parentd6ed7fea4ae611c9418ef9c310b233d9434f1998 (diff)
downloadbrew-df0d4aa8530da406f8e58ee5e6d757acca1045de.tar.bz2
Extract bundle_path from XQuartz.version
-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)