Sha256: 8138217198c3b0bcff08abb7152ba83e6f90b86698bb94fd3f92aa30f85a52ae

Contents?: true

Size: 679 Bytes

Versions: 7

Compression:

Stored size: 679 Bytes

Contents

require 'shellwords'

module SimCtl
  class Command
    module Spawn
      # Spawn a process on a device
      #
      # @param device [SimCtl::Device] the device to spawn a process on
      # @param path [String] path to executable
      # @param args [Array] arguments for the executable
      # @return [String] standard output the spawned process generated
      def spawn(device, path, args = [], _opts = {})
        escaped_path = Shellwords.shellescape(path)
        command = command_for('spawn', device.udid, escaped_path, *args.map { |a| Shellwords.shellwords(a) })
        Executor.execute(command) do |output|
          output
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simctl-1.6.10 lib/simctl/command/spawn.rb
simctl-1.6.8 lib/simctl/command/spawn.rb
simctl-1.6.7 lib/simctl/command/spawn.rb
simctl-1.6.6 lib/simctl/command/spawn.rb
simctl-1.6.5 lib/simctl/command/spawn.rb
simctl-1.6.4 lib/simctl/command/spawn.rb
simctl-1.6.3 lib/simctl/command/spawn.rb