lib/calabash-cucumber/utils/xctools.rb in calabash-cucumber-0.11.4.pre2 vs lib/calabash-cucumber/utils/xctools.rb in calabash-cucumber-0.11.4

- old
+ new

@@ -1,15 +1,16 @@ -require 'open3' require 'run_loop' module Calabash module Cucumber + # @deprecated 0.11.4 Replaced with RunLoop::XCTools. # @!visibility private # Methods for interacting with the xcode tools. module XcodeTools + # @deprecated 0.11.4 Replaced with RunLoop::XCTools. # Returns the path to the current developer directory. # # From the man pages: # # ``` @@ -20,10 +21,11 @@ # directory. #``` # # @return [String] path to current developer directory def xcode_developer_dir + _deprecated('0.11.4', 'Use RunLoop::XCTools', :warn) RunLoop::XCTools.new.xcode_developer_dir end # @deprecated 0.10.0 not replaced # Returns the path to the current developer `usr/bin` directory. @@ -31,10 +33,11 @@ def xcode_bin_dir _deprecated('0.10.0', 'no replacement', :warn) File.expand_path("#{xcode_developer_dir}/usr/bin") end + # @deprecated 0.11.4 Replaced with RunLoop::XCTools. # Method for interacting with instruments. # # @example Getting the path to instruments. # instruments #=> /Applications/Xcode.app/Contents/Developer/usr/bin/instruments # @@ -52,19 +55,22 @@ def instruments(cmd=nil) instruments = 'xcrun instruments' return instruments if cmd == nil case cmd when :version + _deprecated('0.11.4', 'Use RunLoop::XCTools', :warn) RunLoop::XCTools.new.instruments(cmd).to_s when :sims + _deprecated('0.11.4', 'Use RunLoop::XCTools', :warn) RunLoop::XCTools.new.instruments(cmd) else candidates = [:version, :sims] raise(ArgumentError, "expected '#{cmd}' to be one of '#{candidates}'") end end + # @deprecated 0.11.4 Replaced with RunLoop::XCTools. # Does the instruments `version` accept the -s flag? # # @example # instruments_supports_hyphen_s?('4.6.3') => false # instruments_supports_hyphen_s?('5.0.2') => true @@ -73,19 +79,22 @@ # @param [String] version (instruments(:version)) # a major.minor[.patch] version string # # @return [Boolean] true if the version is >= 5.* def instruments_supports_hyphen_s?(version) + _deprecated('0.11.4', 'Use RunLoop::XCTools', :warn) RunLoop::XCTools.new.instruments_supports_hyphen_s?(version) end + # @deprecated 0.11.4 Replaced with RunLoop::XCTools. # Returns a list of installed simulators by calling `$ instruments -s devices`. # and parsing the output # @return [Array<String>] an array of simulator names suitable for passing # to instruments or xcodebuild # @raise [RuntimeError] if the currently active instruments version does # not support the -s flag def installed_simulators + _deprecated('0.11.4', 'Use RunLoop::XCTools', :warn) instruments(:sims) end end end end