fastlane-plugin-stream_actions 0.2.1 → 0.2.3

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
  SHA256:
3
- metadata.gz: e3c68cd290b77976f04143da0e794c1847df520cfcaba6a5649319879202fd69
4
- data.tar.gz: 753cdc1d6d20214fc4ea34689d04d7f641957330ee3ceac98660965de4fd48db
3
+ metadata.gz: 124051989ed2f83ebbc496e45e4e2d7a48f983e717eabfda0f9c50487eeee714
4
+ data.tar.gz: 9e42a4de3c943f65f5cd3a1af0d64442f1e1adf62e2c113efa32c72ce2e78f75
5
5
  SHA512:
6
- metadata.gz: e007bb35ff6c21140c3629dc4640e6b524cfe1645f6496454091bfbf27741dc808051dcf8fe628981c0a7c919be1ced5dff52fb88f48a37b3bfac3721894694f
7
- data.tar.gz: d8f8c2602d1331f2b8aaf8926c1e1e462cd86295a1a97091a6e24b03bfda4a7ab9e26a034a115632788154597baf7a83331a701fb519185a9f4ca09937b83aac
6
+ metadata.gz: cb8db4f96e302722122fae6e41a0a6b3306503847eecb1dedfdaeeb000faa1562d1ce4d8184329b72972d7e2eadf98c77f602985052b19898b5c767c56d8deaa
7
+ data.tar.gz: 0a685921a7938d362c34f50f633c70fdd24b7855c2a3d151d3f0ca253110b2d3a4cf4b61aafdc86f8df17698e96bb1acb1c172dd8867aa23a189d3a0634efc50
@@ -3,21 +3,28 @@ module Fastlane
3
3
  class PrepareSimulatorAction < Action
4
4
  def self.run(params)
5
5
  simulators = FastlaneCore::Simulator.all
6
- version_provided = params[:device] =~ /\((\d+\.)?(\d+\.)?(\*|\d+)\)/
7
- sim = if version_provided
8
- simulators.detect { |d| "#{d.name} (#{d.os_version})" == params[:device] }
9
- else
10
- simulators.filter { |d| d.name == params[:device] }.max_by(&:os_version)
11
- end
12
-
13
- if sim.nil?
14
- simulators.map! { |d| version_provided ? "#{d.name} (#{d.os_version})" : d.name }
15
- UI.user_error!("Simulator #{params[:device]} not found \nAvailable simulators: \n#{simulators.join("\n")}")
6
+ version_regex = /\((\d+\.)?(\d+\.)?(\*|\d+)\)/
7
+ ios_version = params[:device][version_regex]
8
+ device_name = params[:device].sub(version_regex, '').strip
9
+ udid = nil
10
+
11
+ if ios_version.nil?
12
+ sim = simulators.filter { |d| d.name == params[:device] }.max_by(&:os_version)
16
13
  else
17
- sim.reset if params[:reset]
18
- sh("xcrun simctl bootstatus #{sim.udid} -b")
19
- UI.success("Simulator #{sim.name} (#{sim.os_version}) is ready")
14
+ sim = simulators.detect { |d| "#{d.name} (#{d.os_version})" == params[:device] }
15
+ udid = `xcrun simctl create '#{device_name}' '#{device_name}' 'iOS#{ios_version.delete('()')}'` if sim.nil?
20
16
  end
17
+
18
+ udid = sim.udid unless sim.nil?
19
+
20
+ if sim.nil? && (udid.nil? || udid.empty?)
21
+ simulators.map! { |d| "#{d.name} (#{d.os_version})" }.join("\n")
22
+ UI.user_error!("Simulator #{params[:device]} not found \nAvailable simulators: \n#{simulators}")
23
+ end
24
+
25
+ sim.reset if sim && params[:reset]
26
+ sh("xcrun simctl bootstatus #{udid} -b")
27
+ UI.success("Simulator #{device_name} (#{ios_version}) is ready")
21
28
  end
22
29
 
23
30
  #####################################################
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-14 00:00:00.000000000 Z
11
+ date: 2023-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler