lib/run_loop/xcode.rb in run_loop-4.5.4 vs lib/run_loop/xcode.rb in run_loop-4.5.5
- old
+ new
@@ -24,10 +24,18 @@
# Returns debug String representation
def inspect
to_s
end
+ # Returns a version instance for Xcode 12.0; used to check for the
+ # availability of features and paths to various items on the filesystem
+ #
+ # @return [RunLoop::Version] 12.0
+ def v120
+ fetch_version(:v120)
+ end
+
# Returns a version instance for Xcode 11.0; used to check for the
# availability of features and paths to various items on the filesystem
#
# @return [RunLoop::Version] 11.0
def v110
@@ -128,10 +136,17 @@
# @return [RunLoop::Version] 8.0
def v80
fetch_version(:v80)
end
+ # Is the active Xcode version 12.0 or above?
+ #
+ # @return [Boolean] `true` if the current Xcode version is >= 12.0
+ def version_gte_120?
+ version >= v120
+ end
+
# Is the active Xcode version 11.0 or above?
#
# @return [Boolean] `true` if the current Xcode version is >= 11.0
def version_gte_110?
version >= v110
@@ -383,10 +398,10 @@
if !string.start_with?("v")
raise "Expected version key to start with 'v'"
end
- if string.start_with?("v10") || string.start_with?("v11")
+ if string.start_with?("v10") || string.start_with?("v11") || string.start_with?("v12")
expected_length = 4
regex = /v\d{3}/
else
expected_length = 3
regex = /v\d{2}/