simctl 1.6.0 → 1.6.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/simctl.rb +1 -0
- data/lib/simctl/command.rb +2 -0
- data/lib/simctl/command/warmup.rb +21 -0
- data/lib/simctl/version.rb +1 -1
- data/spec/simctl/warmup_spec.rb +21 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 852a8c3916e8ecb03f54d6c79ea9b3bbd7aaab2f
|
4
|
+
data.tar.gz: 4de85baf3b388ca02860fd05065b49be819cfdc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 809ce6cf61c49de8e673e18482ba1cb05ef0c9137da126c09905defa694539b67a4f1c1f4949f9ca4a704f23a7db36db7bba266410f18b8e737f62521cbf50e6
|
7
|
+
data.tar.gz: e52114bf31605dcc5dcbd334a4e843ccbea9f1a50992ddc087f52a09e783428d4a5456ae25c3bda69cc0540cc5823eb7e1925c4c1efe45638d416f1f4b57a8a1
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/simctl.rb
CHANGED
data/lib/simctl/command.rb
CHANGED
@@ -13,6 +13,7 @@ require 'simctl/command/reset'
|
|
13
13
|
require 'simctl/command/shutdown'
|
14
14
|
require 'simctl/command/spawn'
|
15
15
|
require 'simctl/command/uninstall'
|
16
|
+
require 'simctl/command/warmup'
|
16
17
|
require 'simctl/executor'
|
17
18
|
require 'shellwords'
|
18
19
|
|
@@ -35,6 +36,7 @@ module SimCtl
|
|
35
36
|
include SimCtl::Command::Shutdown
|
36
37
|
include SimCtl::Command::Spawn
|
37
38
|
include SimCtl::Command::Uninstall
|
39
|
+
include SimCtl::Command::Warmup
|
38
40
|
|
39
41
|
def device_set_path=(device_set_path)
|
40
42
|
@device_set_path = File.expand_path(device_set_path)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module SimCtl
|
2
|
+
class Command
|
3
|
+
module Warmup
|
4
|
+
# Warms up a device and waits for it to be ready
|
5
|
+
#
|
6
|
+
# @param devicetype [String] device type string
|
7
|
+
# @param runtime [String] runtime string
|
8
|
+
# @param timeout [Integer] timeout in seconds to wait until device is ready
|
9
|
+
# @return [SimCtl::Device]
|
10
|
+
def warmup(devicetype, runtime, timeout=120)
|
11
|
+
devicetype = devicetype(name: devicetype) unless devicetype.is_a?(DeviceType)
|
12
|
+
runtime = runtime(name: runtime) unless runtime.is_a?(Runtime)
|
13
|
+
device = device(devicetype: devicetype, runtime: runtime)
|
14
|
+
raise DeviceNotFound.new("Could not find device with type '#{devicetype.name}' and runtime '#{runtime.name}'") if device.nil?
|
15
|
+
device.launch
|
16
|
+
device.wait(timeout) {|d| d.state == :booted && d.ready?}
|
17
|
+
device
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/simctl/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe SimCtl do
|
4
|
+
describe '#warmup' do
|
5
|
+
if SimCtl.device_set_path.nil?
|
6
|
+
it 'warms up and returns a device for given strings' do
|
7
|
+
expect(SimCtl.warmup('iPhone 6', 'iOS 9.3')).to be_kind_of SimCtl::Device
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'warms up and returns a device for given objects' do
|
11
|
+
devicetype = SimCtl.devicetype(name: 'iPhone 5')
|
12
|
+
runtime = SimCtl::Runtime.latest(:ios)
|
13
|
+
expect(SimCtl.warmup(devicetype, runtime)).to be_kind_of SimCtl::Device
|
14
|
+
end
|
15
|
+
else
|
16
|
+
it 'raises exception' do
|
17
|
+
expect { SimCtl.warmup('iPhone 6', 'iOS 9.3') }.to raise_error SimCtl::DeviceNotFound
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simctl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Plunien
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- lib/simctl/command/shutdown.rb
|
114
114
|
- lib/simctl/command/spawn.rb
|
115
115
|
- lib/simctl/command/uninstall.rb
|
116
|
+
- lib/simctl/command/warmup.rb
|
116
117
|
- lib/simctl/device.rb
|
117
118
|
- lib/simctl/device_launchctl.rb
|
118
119
|
- lib/simctl/device_path.rb
|
@@ -137,6 +138,7 @@ files:
|
|
137
138
|
- spec/simctl/executor_spec.rb
|
138
139
|
- spec/simctl/list_spec.rb
|
139
140
|
- spec/simctl/readme_spec.rb
|
141
|
+
- spec/simctl/warmup_spec.rb
|
140
142
|
- spec/spec_helper.rb
|
141
143
|
homepage: https://github.com/plu/simctl
|
142
144
|
licenses:
|
@@ -174,4 +176,5 @@ test_files:
|
|
174
176
|
- spec/simctl/executor_spec.rb
|
175
177
|
- spec/simctl/list_spec.rb
|
176
178
|
- spec/simctl/readme_spec.rb
|
179
|
+
- spec/simctl/warmup_spec.rb
|
177
180
|
- spec/spec_helper.rb
|