Sha256: 2a943a6cb3fe1bb4fa665f56ad1bf4e67b13b1d82f7663f4e70ab3dd85389b9c

Contents?: true

Size: 1.37 KB

Versions: 13

Compression:

Stored size: 1.37 KB

Contents

module RunLoop
  # @!visibility private
  module DeviceAgent
    # @!visibility private
    #
    # A base class for something that can launch the DeviceAgent-Runner on a
    # device.
    class LauncherStrategy
      require "run_loop/abstract"
      include RunLoop::Abstract

      # @!visibility private
      attr_reader :device

      # @!visibility private
      # @param [RunLoop::Device] device where to launch the DeviceAgent-Runner
      def initialize(device)
        @device = device

        if device.version < RunLoop::Version.new("9.0")
          raise ArgumentError, %Q[
Invalid device:

#{device}

DeviceAgent is only available for iOS >= 9.0
]
        end
      end

      # @!visibility private
      # The name of this launcher. Must be a symbol (keyword).  This value will
      # be used for the key :cbx_launcher in the RunLoop::Cache so Calabash
      # iOS can attach and reattach to a DeviceAgent instance.
      def name
        abstract_method!
      end

      # @!visibility private
      #
      # Does whatever it takes to launch the DeviceAgent-Runner on the device.
      def launch(options)
        abstract_method!
      end

      # @!visibility private
      def self.dot_dir
        path = File.join(RunLoop::DotDir.directory, "xcuitest")

        if !File.exist?(path)
          FileUtils.mkdir_p(path)
        end

        path
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
run_loop-2.3.2 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.4.0 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.3.1 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.3.0 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.2.4 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.2.3 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.2.2 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.2.1 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.2.0 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.1.11 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.1.10 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.1.9 lib/run_loop/device_agent/launcher_strategy.rb
run_loop-2.1.8 lib/run_loop/device_agent/launcher_strategy.rb