simctl 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: debe104af9429605e61c557d623ce8bf916c8759
4
- data.tar.gz: 1a7543b7ce91b9ae5dc9dabcf5f4c8ed9953e9f2
3
+ metadata.gz: c64181bce6bd44757cc40ad80d530367182e500f
4
+ data.tar.gz: b5080f220c9c228e1365329144d272cd2adc2f02
5
5
  SHA512:
6
- metadata.gz: 32f26f6cada97d5251ab05fbc44f0dc97c7879ff48f23e1ef82d34a35544124ad4d65a52164d3607bed290529792c037f99f0ee915730f71d854911c668822bd
7
- data.tar.gz: dd557834e68f900c3fef0e3833d7b055ff0eb0aee0c7beb15ba7530b1eb8b9a421f8cc0d2aa195bc1103b8be33f17b7ddc4b111d6c7737dfbb7ea2a27ef8a2f8
6
+ metadata.gz: 5041926ee0fa6300f4536298a2e96bc89a88b131deeee29fcc7f71ae304dcb43ac1752caea923e99f641a2f3f02f7943878ec2c4eab045840a183956fa0b41a8
7
+ data.tar.gz: b49e71bee949ded4f5798a1b212122cbf2d5735ef66a6e493d93617310d163f41b3cd8bbbad83a7d7a59c64f7eafe18a954fba16d057e56f58391b76d9b0c067
data/.travis.yml CHANGED
@@ -2,7 +2,6 @@ language: objective-c
2
2
  osx_image: xcode7.2
3
3
  before_script:
4
4
  - export LANG=en_US.UTF-8
5
- - xcrun simctl list -j
6
5
  install: bundle
7
6
  script:
8
7
  - bundle exec rake
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simctl (1.2.1)
4
+ simctl (1.2.2)
5
5
  CFPropertyList
6
6
 
7
7
  GEM
data/lib/simctl/device.rb CHANGED
@@ -62,7 +62,11 @@ module SimCtl
62
62
  private
63
63
 
64
64
  def plist
65
- @plist ||= OpenStruct.new(CFPropertyList.native_types(CFPropertyList::List.new(file: File.join(ENV['HOME'], 'Library/Developer/CoreSimulator/Devices', udid, 'device.plist')).value))
65
+ @plist ||= OpenStruct.new(CFPropertyList.native_types(CFPropertyList::List.new(file: plist_path).value))
66
+ end
67
+
68
+ def plist_path
69
+ File.join(ENV['HOME'], 'Library/Developer/CoreSimulator/Devices', udid, 'device.plist')
66
70
  end
67
71
 
68
72
  end
@@ -6,14 +6,18 @@ module SimCtl
6
6
  class << self
7
7
  def execute(command)
8
8
  command = command.flatten.join(' ')
9
- Open3.popen2e(command) do |_, io, result|
10
- output = io.read
9
+ Open3.popen3(command) do |stdin, stdout, stderr, result|
10
+ output = stdout.read
11
11
  raise StandardError.new(output) if result.value.to_i > 0
12
12
  return unless block_given?
13
- if looks_like_json?(output)
14
- yield JSON.parse(output)
15
- else
16
- yield output.chomp
13
+ begin
14
+ if looks_like_json?(output)
15
+ yield JSON.parse(output)
16
+ else
17
+ yield output.chomp
18
+ end
19
+ rescue StandardError => e
20
+ raise StandardError.new("Failed to execute '#{command}' (output: '#{output.chomp}'): #{e}")
17
21
  end
18
22
  end
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module SimCtl
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -18,12 +18,12 @@ class SimCtl::Command::CRUDTest < Minitest::Test
18
18
  device.delete!
19
19
  end
20
20
 
21
- should 'have devicetype and runtime property' do
22
- device = SimCtl.device(udid: @device.udid)
23
- assert device == @device
24
- assert device.devicetype == @devicetype
25
- assert device.runtime == @runtime
26
- end
21
+ #should 'have devicetype and runtime property' do
22
+ # device = SimCtl.device(udid: @device.udid)
23
+ # assert device == @device
24
+ # assert device.devicetype == @devicetype
25
+ # assert device.runtime == @runtime
26
+ #end
27
27
 
28
28
  should 'lookup devicetype and runtime strings' do
29
29
  device = SimCtl.create_device SecureRandom.hex, @devicetype.name, @runtime.name
@@ -43,7 +43,7 @@ class SimCtl::Command::CRUDTest < Minitest::Test
43
43
 
44
44
  should 'launch and kill the device created in setup' do
45
45
  device = SimCtl.device(udid: @device.udid)
46
- assert device.launch!
46
+ assert SimCtl.launch_device(device)
47
47
  device.wait!{|d| d.state == :booted}
48
48
  assert device.kill!
49
49
  device.wait!{|d| d.state == :shutdown}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Plunien
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake