Sha256: 0e728b489a026ef5082408057df4e35cde1f8fa8d0fc021ebf9e40fe62f62dee

Contents?: true

Size: 423 Bytes

Versions: 7

Compression:

Stored size: 423 Bytes

Contents

require 'ostruct'

module SimCtl
  class DeviceLaunchctl
    def initialize(device)
      @device = device
    end

    def list
      fields = %i[pid status name]
      device
        .spawn(device.path.launchctl, ['list'])
        .split("\n")
        .drop(1)
        .map { |item| Hash[fields.zip(item.split("\t"))] }
        .map { |item| OpenStruct.new(item) }
    end

    private

    attr_reader :device
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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