simctl 1.6.5 → 1.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4da9bc793a0003153b77575cb17eedb33d94e1b8
4
- data.tar.gz: 822cbdebaeacfcc0942ec71bfd515bbfe32bc1ed
2
+ SHA256:
3
+ metadata.gz: 8e2a17c1694402d480a1b2c2907d912c118d6aaa91752a8977c69097fe05cab2
4
+ data.tar.gz: c1e185640f21153f13caf85c3f5ba5d2758689d865c10487b25997576c718fb1
5
5
  SHA512:
6
- metadata.gz: b9a923769fdf035ac3a1daf4566bb9069b76ffff895f927f9ad9ec1579bdee076195109937bfadcaa03b45548251420195bce5e2b8c8d3eac71eee7abf130483
7
- data.tar.gz: c2d952b9a6313dc4ee166e11efdda1c151cbc8b1a58d0cb9b9e5035b0628f23b529ac2173c8f0c8d84fc3b75de1bd60a59b2efedce023d78095c4e8580c3f23a
6
+ metadata.gz: cce62d9925abb6cd995d50c82a35cab1214f66f66769767c62b6ea5757378a10647263727b10b87c5804272c9fb9424c0c70fe5187c98a194cd8dde7b5b91828
7
+ data.tar.gz: 9a99d1ae842b20561900bcb56342b7433b97d2118248876ebb84084d5ba480db058054429a041becf4c154e45aaff124b91fb7834538beb3b489c4cae41a057f
@@ -38,7 +38,7 @@ Metrics/BlockLength:
38
38
  # Offense count: 1
39
39
  # Configuration parameters: CountComments.
40
40
  Metrics/ClassLength:
41
- Max: 145
41
+ Max: 200
42
42
 
43
43
  # Offense count: 58
44
44
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
@@ -2,16 +2,16 @@ language: objective-c
2
2
  matrix:
3
3
  include:
4
4
  - os: osx
5
- osx_image: xcode8.3
5
+ osx_image: xcode10.3
6
6
  env: CUSTOM_DEVICE_SET_PATH=true
7
7
  - os: osx
8
- osx_image: xcode8.3
8
+ osx_image: xcode10.3
9
9
  env: CUSTOM_DEVICE_SET_PATH=false
10
10
  - os: osx
11
- osx_image: xcode9
11
+ osx_image: xcode11
12
12
  env: CUSTOM_DEVICE_SET_PATH=true
13
13
  - os: osx
14
- osx_image: xcode9
14
+ osx_image: xcode11
15
15
  env: CUSTOM_DEVICE_SET_PATH=false
16
16
  before_script:
17
17
  - export LANG=en_US.UTF-8
@@ -1,3 +1,7 @@
1
+ # 1.6.6
2
+
3
+ * Fix `device.reset`
4
+
1
5
  # 1.6.4
2
6
 
3
7
  * Device locale can now be set via `device.set_locale('en_EN')`
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simctl (1.6.5)
4
+ simctl (1.6.6)
5
5
  CFPropertyList
6
6
  naturally
7
7
 
@@ -9,37 +9,37 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  CFPropertyList (3.0.0)
12
- ast (2.3.0)
13
- coveralls (0.8.17)
12
+ ast (2.4.0)
13
+ coveralls (0.8.23)
14
14
  json (>= 1.8, < 3)
15
- simplecov (~> 0.12.0)
15
+ simplecov (~> 0.16.1)
16
16
  term-ansicolor (~> 1.3)
17
- thor (~> 0.19.1)
17
+ thor (>= 0.19.4, < 2.0)
18
18
  tins (~> 1.6)
19
- diff-lcs (1.2.5)
20
- docile (1.1.5)
21
- json (2.0.2)
19
+ diff-lcs (1.3)
20
+ docile (1.3.2)
21
+ json (2.2.0)
22
22
  naturally (2.2.0)
23
- parallel (1.12.0)
24
- parser (2.4.0.0)
25
- ast (~> 2.2)
26
- powerpack (0.1.1)
23
+ parallel (1.17.0)
24
+ parser (2.6.3.0)
25
+ ast (~> 2.4.0)
26
+ powerpack (0.1.2)
27
27
  rainbow (2.2.2)
28
28
  rake
29
- rake (12.0.0)
30
- rspec (3.5.0)
31
- rspec-core (~> 3.5.0)
32
- rspec-expectations (~> 3.5.0)
33
- rspec-mocks (~> 3.5.0)
34
- rspec-core (3.5.4)
35
- rspec-support (~> 3.5.0)
36
- rspec-expectations (3.5.0)
29
+ rake (12.3.3)
30
+ rspec (3.8.0)
31
+ rspec-core (~> 3.8.0)
32
+ rspec-expectations (~> 3.8.0)
33
+ rspec-mocks (~> 3.8.0)
34
+ rspec-core (3.8.2)
35
+ rspec-support (~> 3.8.0)
36
+ rspec-expectations (3.8.4)
37
37
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.5.0)
39
- rspec-mocks (3.5.0)
38
+ rspec-support (~> 3.8.0)
39
+ rspec-mocks (3.8.1)
40
40
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.5.0)
42
- rspec-support (3.5.0)
41
+ rspec-support (~> 3.8.0)
42
+ rspec-support (3.8.2)
43
43
  rubocop (0.49.1)
44
44
  parallel (~> 1.10)
45
45
  parser (>= 2.3.3.1, < 3.0)
@@ -47,17 +47,17 @@ GEM
47
47
  rainbow (>= 1.99.1, < 3.0)
48
48
  ruby-progressbar (~> 1.7)
49
49
  unicode-display_width (~> 1.0, >= 1.0.1)
50
- ruby-progressbar (1.8.1)
51
- simplecov (0.12.0)
52
- docile (~> 1.1.0)
50
+ ruby-progressbar (1.10.1)
51
+ simplecov (0.16.1)
52
+ docile (~> 1.1)
53
53
  json (>= 1.8, < 3)
54
54
  simplecov-html (~> 0.10.0)
55
- simplecov-html (0.10.0)
56
- term-ansicolor (1.4.0)
55
+ simplecov-html (0.10.2)
56
+ term-ansicolor (1.7.1)
57
57
  tins (~> 1.0)
58
- thor (0.19.4)
59
- tins (1.13.0)
60
- unicode-display_width (1.3.0)
58
+ thor (0.20.3)
59
+ tins (1.21.1)
60
+ unicode-display_width (1.6.0)
61
61
 
62
62
  PLATFORMS
63
63
  ruby
@@ -66,8 +66,8 @@ DEPENDENCIES
66
66
  coveralls
67
67
  rake
68
68
  rspec
69
- rubocop
69
+ rubocop (= 0.49.1)
70
70
  simctl!
71
71
 
72
72
  BUNDLED WITH
73
- 1.16.1
73
+ 1.17.3
data/README.md CHANGED
@@ -9,14 +9,17 @@ Ruby interface to xcrun simctl. Manage your iOS Simulators directly from a ruby
9
9
  ```ruby
10
10
  require 'simctl'
11
11
 
12
- # Select the iOS 9.3 runtime
13
- runtime = SimCtl.runtime(name: 'iOS 9.3')
12
+ # Select the iOS 12.1 runtime
13
+ runtime = SimCtl.runtime(name: 'iOS 12.1')
14
14
 
15
15
  # Select the iPhone 6 device type
16
16
  devicetype = SimCtl.devicetype(name: 'iPhone 6')
17
17
 
18
18
  # Create a new device
19
- device = SimCtl.create_device 'Unit Tests @ iPhone 6 9.3', devicetype, runtime
19
+ device = SimCtl.create_device 'Unit Tests @ iPhone 6 - 12.1', devicetype, runtime
20
+
21
+ # Boot the device
22
+ device.boot
20
23
 
21
24
  # Launch a new Simulator.app instance
22
25
  device.launch
@@ -37,7 +40,7 @@ device.delete
37
40
 
38
41
  ## License (MIT)
39
42
 
40
- Copyright (C) 2016 Johannes Plunien
43
+ Copyright (C) 2019 Johannes Plunien
41
44
 
42
45
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
43
46
 
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_dependency 'simctl', '~> 1.6.2'
20
+ spec.add_dependency 'simctl', '~> 1.6.5'
21
21
 
22
22
  spec.add_development_dependency 'pry'
23
23
  spec.add_development_dependency 'bundler'
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Simctl
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ module SimCtl
10
10
  # @yield [exception] an exception that might happen during shutdown/delete of the old device
11
11
  def reset_device(name, device_type, runtime)
12
12
  begin
13
- list_devices.where(name: name, os: runtime.name).each do |device|
13
+ list_devices.where(name: name, os: runtime.identifier).each do |device|
14
14
  device.kill
15
15
  device.shutdown if device.state != :shutdown
16
16
  device.wait { |d| d.state == :shutdown }
@@ -12,7 +12,7 @@ module SimCtl
12
12
  runtime = runtime(name: runtime) unless runtime.is_a?(Runtime)
13
13
  device = device(devicetype: devicetype, runtime: runtime)
14
14
  raise DeviceNotFound, "Could not find device with type '#{devicetype.name}' and runtime '#{runtime.name}'" if device.nil?
15
- device.launch
15
+ device.boot if device.state != :booted
16
16
  device.wait(timeout) { |d| d.state == :booted && d.ready? }
17
17
  device
18
18
  end
@@ -8,13 +8,25 @@ require 'timeout'
8
8
 
9
9
  module SimCtl
10
10
  class Device < Object
11
- attr_reader :availability, :name, :os, :state, :udid
11
+ extend Gem::Deprecate
12
+
13
+ attr_reader :is_available, :name, :os, :state, :udid
14
+
15
+ def initialize(args)
16
+ args['is_available'] = args.delete('isAvailable')
17
+ super
18
+ end
19
+
20
+ def availability
21
+ is_available
22
+ end
23
+ deprecate :availability, :is_available, 2020, 8
12
24
 
13
25
  # Returns true/false if the device is available
14
26
  #
15
27
  # @return [Bool]
16
28
  def available?
17
- availability !~ /unavailable/i
29
+ is_available !~ /unavailable/i
18
30
  end
19
31
 
20
32
  # Boots the device
@@ -3,7 +3,19 @@ require 'simctl/object'
3
3
 
4
4
  module SimCtl
5
5
  class Runtime < Object
6
- attr_reader :availability, :buildversion, :identifier, :name, :type, :version
6
+ extend Gem::Deprecate
7
+
8
+ attr_reader :buildversion, :identifier, :is_available, :name, :type, :version
9
+
10
+ def initialize(args)
11
+ args['is_available'] = args.delete('isAvailable')
12
+ super
13
+ end
14
+
15
+ def availability
16
+ is_available
17
+ end
18
+ deprecate :availability, :is_available, 2020, 8
7
19
 
8
20
  def type
9
21
  @type ||= name.split("\s").first.downcase.to_sym
@@ -1,3 +1,3 @@
1
1
  module SimCtl
2
- VERSION = '1.6.5'.freeze
2
+ VERSION = '1.6.6'.freeze
3
3
  end
@@ -11,7 +11,9 @@ module SimCtl
11
11
  end
12
12
 
13
13
  def runtime_profiles
14
- if Xcode::Version.gte? '9.0'
14
+ if Xcode::Version.gte? '11.0'
15
+ File.join(home, 'Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/')
16
+ elsif Xcode::Version.gte? '9.0'
15
17
  File.join(home, 'Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/')
16
18
  else
17
19
  File.join(home, 'Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/')
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'coveralls'
23
23
  s.add_development_dependency 'rake'
24
24
  s.add_development_dependency 'rspec'
25
- s.add_development_dependency 'rubocop'
25
+ s.add_development_dependency 'rubocop', '=0.49.1'
26
26
 
27
27
  s.add_dependency 'CFPropertyList'
28
28
  s.add_dependency 'naturally'
@@ -4,7 +4,7 @@ require 'spec_helper'
4
4
  RSpec.describe SimCtl, order: :defined do
5
5
  before(:all) do
6
6
  @name = SecureRandom.hex
7
- @devicetype = SimCtl.devicetype(name: 'iPhone 6')
7
+ @devicetype = SimCtl.devicetype(name: 'iPhone 8')
8
8
  @runtime = SimCtl::Runtime.latest(:ios)
9
9
  @device = SimCtl.create_device @name, @devicetype, @runtime
10
10
  @device.wait { |d| d.state == :shutdown }
@@ -44,7 +44,7 @@ RSpec.describe SimCtl, order: :defined do
44
44
  end
45
45
 
46
46
  it 'has a availability property' do
47
- expect(@device.availability).not_to be_nil
47
+ expect(@device.is_available).not_to be_nil
48
48
  end
49
49
 
50
50
  it 'has a os property' do
@@ -56,6 +56,16 @@ RSpec.describe SimCtl, order: :defined do
56
56
  end
57
57
 
58
58
  describe '#path' do
59
+ before(:all) do
60
+ @device.boot
61
+ @device.wait { |d| File.exist?(d.path.device_plist) && File.exist?(d.path.global_preferences_plist) }
62
+ end
63
+
64
+ after(:all) do
65
+ @device.shutdown
66
+ @device.wait { |d| d.state == :shutdown }
67
+ end
68
+
59
69
  it 'has a device plist' do
60
70
  expect(File).to exist(@device.path.device_plist)
61
71
  end
@@ -148,7 +158,7 @@ RSpec.describe SimCtl, order: :defined do
148
158
 
149
159
  describe 'launching the device' do
150
160
  it 'launches the device' do
151
- @device.launch
161
+ @device.boot
152
162
  @device.wait { |d| d.state == :booted }
153
163
  expect(@device.state).to be == :booted
154
164
  end
@@ -226,13 +236,13 @@ RSpec.describe SimCtl, order: :defined do
226
236
  end
227
237
  end
228
238
 
229
- describe 'killing the device' do
239
+ describe 'shutdown the device' do
230
240
  it 'state is booted' do
231
241
  expect(@device.state).to be == :booted
232
242
  end
233
243
 
234
- it 'kills the device' do
235
- @device.kill
244
+ it 'shuts down the device' do
245
+ @device.shutdown
236
246
  @device.wait { |d| d.state == :shutdown }
237
247
  end
238
248
 
@@ -293,7 +303,8 @@ RSpec.describe SimCtl, order: :defined do
293
303
  it 'deletes the device' do
294
304
  device = SimCtl.create_device @name, @devicetype, @runtime
295
305
  device.delete
296
- expect(SimCtl.device(udid: @device.udid)).to be_nil
306
+ device.wait { SimCtl.device(udid: device.udid).nil? }
307
+ expect(SimCtl.device(udid: device.udid)).to be_nil
297
308
  end
298
309
  end
299
310
  end
@@ -39,7 +39,7 @@ RSpec.describe SimCtl do
39
39
  end
40
40
 
41
41
  it 'parses availability property' do
42
- expect(SimCtl.list_runtimes.first.availability).not_to be_nil
42
+ expect(SimCtl.list_runtimes.first.is_available).not_to be_nil
43
43
  end
44
44
 
45
45
  it 'parses buildversion property' do
@@ -69,7 +69,7 @@ RSpec.describe SimCtl do
69
69
 
70
70
  describe '#runtime' do
71
71
  it 'find runtime by name' do
72
- expect(SimCtl.runtime(name: 'iOS 9.3')).to be_kind_of SimCtl::Runtime
72
+ expect(SimCtl.runtime(name: 'iOS 12.1')).to be_kind_of SimCtl::Runtime
73
73
  end
74
74
 
75
75
  it 'raise exception if runtime is not found' do
@@ -77,7 +77,11 @@ RSpec.describe SimCtl do
77
77
  end
78
78
 
79
79
  it 'finds the latest runtime' do
80
- if SimCtl::Xcode::Version.gte?('9.0')
80
+ if SimCtl::Xcode::Version.gte?('11.0')
81
+ expect(SimCtl::Runtime.latest(:ios).version).to be == '13.0'
82
+ elsif SimCtl::Xcode::Version.gte?('10.3')
83
+ expect(SimCtl::Runtime.latest(:ios).version).to be == '12.4'
84
+ elsif SimCtl::Xcode::Version.gte?('9.0')
81
85
  expect(SimCtl::Runtime.latest(:ios).version).to be == '11.0'
82
86
  elsif SimCtl::Xcode::Version.gte?('8.3')
83
87
  expect(SimCtl::Runtime.latest(:ios).version).to be == '10.3.1'
@@ -2,14 +2,17 @@ require 'spec_helper'
2
2
 
3
3
  RSpec.describe SimCtl do
4
4
  it 'executes example code from readme' do
5
- # Select the iOS 9.3 runtime
6
- runtime = SimCtl.runtime(name: 'iOS 9.3')
5
+ # Select the iOS 12.1 runtime
6
+ runtime = SimCtl.runtime(name: 'iOS 12.1')
7
7
 
8
8
  # Select the iPhone 6 device type
9
9
  devicetype = SimCtl.devicetype(name: 'iPhone 6')
10
10
 
11
11
  # Create a new device
12
- device = SimCtl.create_device 'Unit Tests @ iPhone 6 9.3', devicetype, runtime
12
+ device = SimCtl.create_device 'Unit Tests @ iPhone 6 - 12.1', devicetype, runtime
13
+
14
+ # Boot the device
15
+ device.boot
13
16
 
14
17
  # Launch a new Simulator.app instance
15
18
  device.launch
@@ -4,7 +4,7 @@ RSpec.describe SimCtl do
4
4
  describe '#warmup' do
5
5
  if SimCtl.device_set_path.nil?
6
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
7
+ expect(SimCtl.warmup('iPhone 6', 'iOS 12.1')).to be_kind_of SimCtl::Device
8
8
  end
9
9
 
10
10
  it 'warms up and returns a device for given objects' do
@@ -14,7 +14,7 @@ RSpec.describe SimCtl do
14
14
  end
15
15
  else
16
16
  it 'raises exception' do
17
- expect { SimCtl.warmup('iPhone 6', 'iOS 9.3') }.to raise_error SimCtl::DeviceNotFound
17
+ expect { SimCtl.warmup('iPhone 6', 'iOS 12.1') }.to raise_error SimCtl::DeviceNotFound
18
18
  end
19
19
  end
20
20
  end
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.6.5
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Plunien
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-20 00:00:00.000000000 Z
11
+ date: 2019-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.49.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 0.49.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: CFPropertyList
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -191,8 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubyforge_project:
195
- rubygems_version: 2.6.11
194
+ rubygems_version: 3.0.3
196
195
  signing_key:
197
196
  specification_version: 4
198
197
  summary: Ruby interface to xcrun simctl