mac/xquartz: compare with existing Version class.
This commit is contained in:
parent
600d58f4ca
commit
389188ac4f
@ -34,7 +34,11 @@ module OS
|
|||||||
# The X11.app distributed by Apple is also XQuartz, and therefore covered
|
# The X11.app distributed by Apple is also XQuartz, and therefore covered
|
||||||
# by this method.
|
# by this method.
|
||||||
def version
|
def version
|
||||||
@version ||= detect_version
|
if @version ||= detect_version
|
||||||
|
::Version.new @version
|
||||||
|
else
|
||||||
|
::Version::NULL
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def detect_version
|
def detect_version
|
||||||
@ -115,7 +119,13 @@ module OS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def installed?
|
def installed?
|
||||||
!version.nil? && !prefix.nil?
|
!version.null? && !prefix.nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
def outdated?
|
||||||
|
return false unless installed?
|
||||||
|
return false if provided_by_apple?
|
||||||
|
version < latest_version
|
||||||
end
|
end
|
||||||
|
|
||||||
# If XQuartz and/or the CLT are installed, headers will be found under
|
# If XQuartz and/or the CLT are installed, headers will be found under
|
||||||
|
Loading…
x
Reference in New Issue
Block a user