lib/run_loop/xctools.rb in run_loop-1.0.7 vs lib/run_loop/xctools.rb in run_loop-1.0.8

- old
+ new

@@ -17,10 +17,18 @@ # Returns a version instance for `Xcode 6.0`; used to check for the # availability of features and paths to various items on the filesystem. # # @return [RunLoop::Version] 6.0 + def v61 + @xc61 ||= RunLoop::Version.new('6.1') + end + + # Returns a version instance for `Xcode 6.0`; used to check for the + # availability of features and paths to various items on the filesystem. + # + # @return [RunLoop::Version] 6.0 def v60 @xc60 ||= RunLoop::Version.new('6.0') end # Returns a version instance for `Xcode 5.1`; used to check for the @@ -37,10 +45,17 @@ # @return [RunLoop::Version] 5.0 def v50 @xc50 ||= RunLoop::Version.new('5.0') end + # Are we running Xcode 6.1 or above? + # + # @return [Boolean] `true` if the current Xcode version is >= 6.1 + def xcode_version_gte_61? + @xcode_gte_61 ||= xcode_version >= v61 + end + # Are we running Xcode 6 or above? # # @return [Boolean] `true` if the current Xcode version is >= 6.0 def xcode_version_gte_6? @xcode_gte_6 ||= xcode_version >= v60 @@ -140,10 +155,19 @@ }.call when :templates @instruments_templates ||= lambda { cmd = "#{instruments} -s templates" - if self.xcode_version >= self.v60 + if self.xcode_version >= self.v61 + Open3.popen3(cmd) do |_, stdout, stderr, _| + stderr_filter.call(stderr) + stdout.read.chomp.split("\n").map do |line| + line.strip.tr('"', '') + end.delete_if do |path| + not path =~ /tracetemplate/ + end + end + elsif self.xcode_version >= self.v60 Open3.popen3(cmd) do |_, stdout, stderr, _| stderr_filter.call(stderr) stdout.read.chomp.split("\n").map { |elm| elm.strip.tr('"', '') } end elsif self.xcode_version >= self.v51