fastlane-plugin-simctl 0.1.0 → 0.2.0

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
2
  SHA1:
3
- metadata.gz: 9068aa4da653658cb8fea4137728b86b1ae4d72c
4
- data.tar.gz: c204049c00ee31d7e192de64319850c0af3dd623
3
+ metadata.gz: 2ccae2979a0070743df0dfb326bd0d2f3810f680
4
+ data.tar.gz: 7fd3a758ca840a3a4c2007abe6d56f15c590e5d9
5
5
  SHA512:
6
- metadata.gz: c395deda36868d420edf45d58b8d03a52c2ee774397c72cb889f70ec986dd8b92560a178381154ace6d0ae5230b1de9a35173fb57ce87e1f9bb1236306da474d
7
- data.tar.gz: ca95a2b690981117d16d3d2dff1654c00cf09c7712ab8150bea2b8e8f2dfbffcd1a5fcead5f8507efbf9b79bd595cd5b6bbeb52903f8dc9d19f1c9caa3303cb6
6
+ metadata.gz: 39f76c189688d3f14ccd231ee7ccbc4ceba4a2ba4927564edc39c099cdccd62736423cfaff1aa8d4140f744da894959d5d26c10b57f7c7d6d16cd9fd72f3a4fa
7
+ data.tar.gz: d5d7c274a634a0d8c8b809000fba29bd8c4efab49c199357d6dc32523d40d003d73039a1cfc6d31de78de39b50ada1bf596c568838a91b72056de5befd456441
@@ -4,7 +4,7 @@ module Fastlane
4
4
  module Actions
5
5
  class SimctlAction < Action
6
6
  def self.run(params)
7
- Helper::SimctlHelper.execute_with_simulator_ready(params[:block], params[:runtime], params[:type])
7
+ Helper::SimctlHelper.execute_with_simulator_ready(self, params[:block], params[:runtime], params[:type], params[:name])
8
8
  end
9
9
 
10
10
  def self.description
@@ -34,7 +34,12 @@ module Fastlane
34
34
  description: "iOS device type used to create the simulator",
35
35
  optional: true,
36
36
  type: String,
37
- default_value: 'iPhone 6')
37
+ default_value: 'iPhone 6'),
38
+ FastlaneCore::ConfigItem.new(key: :name,
39
+ description: "String used to set the name to the simulator",
40
+ optional: true,
41
+ type: String,
42
+ default_value: nil)
38
43
  ]
39
44
  end
40
45
 
@@ -1,15 +1,15 @@
1
1
  module Fastlane
2
2
  module Helper
3
3
  class SimctlHelper
4
- def self.execute_with_simulator_ready(block, runtime, type)
5
- device = create_device(runtime, type)
4
+ def self.execute_with_simulator_ready(action, block, runtime, type, name)
5
+ device = create_device(runtime, type, name)
6
6
  device.launch
7
7
  device.wait(90) do |d|
8
8
  Fastlane::UI.message("Waiting for simulator `#{d.name}` to be ready")
9
9
  d.state == :booted && d.ready?
10
10
  end
11
11
  begin
12
- block.call(device)
12
+ block.call(action.other_action, device)
13
13
  rescue StandardError => error
14
14
  throw error
15
15
  ensure
@@ -17,16 +17,19 @@ module Fastlane
17
17
  end
18
18
  end
19
19
 
20
- def self.create_device(runtime, type)
20
+ def self.create_device(runtime, type, name)
21
21
  runtime = if runtime.eql? 'latest'
22
22
  SimCtl::Runtime.latest('ios')
23
23
  else
24
24
  SimCtl.runtime(name: runtime)
25
25
  end
26
26
  device_type = SimCtl.devicetype(name: type)
27
- device_name = type.to_s
28
- device_name += "-#{ENV['JOB_NAME']}" if ENV['JOB_NAME']
29
- device_name += "@#{ENV['BUILD_NUMBER']}" if ENV['BUILD_NUMBER']
27
+ device_name = name
28
+ device_name ||= type.to_s.instance_eval do |obj|
29
+ obj += "-#{ENV['JOB_NAME']}" if ENV['JOB_NAME']
30
+ obj += "@#{ENV['BUILD_NUMBER']}" if ENV['BUILD_NUMBER']
31
+ obj
32
+ end
30
33
  Fastlane::UI.message("Starting simulator with runtime: `#{runtime.name}`, device type: `#{device_type.name}`"\
31
34
  " and device name: `#{device_name}`")
32
35
  SimCtl.reset_device(device_name, device_type, runtime)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Simctl
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-simctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renzo Crisostomo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-09 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simctl
@@ -158,3 +158,4 @@ signing_key:
158
158
  specification_version: 4
159
159
  summary: Fastlane plugin to interact with xcrun simctl
160
160
  test_files: []
161
+ has_rdoc: