fastlane-plugin-stream_actions 0.2.1 → 0.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
  SHA256:
3
- metadata.gz: e3c68cd290b77976f04143da0e794c1847df520cfcaba6a5649319879202fd69
4
- data.tar.gz: 753cdc1d6d20214fc4ea34689d04d7f641957330ee3ceac98660965de4fd48db
3
+ metadata.gz: 51515d694ad7ffe607e7ac905bec535762ce45e2864182a584c13be2f5f03407
4
+ data.tar.gz: '0966ff481d55fd371210ea3a91eaaa93d2b152925adf89f378dde406228a40e4'
5
5
  SHA512:
6
- metadata.gz: e007bb35ff6c21140c3629dc4640e6b524cfe1645f6496454091bfbf27741dc808051dcf8fe628981c0a7c919be1ced5dff52fb88f48a37b3bfac3721894694f
7
- data.tar.gz: d8f8c2602d1331f2b8aaf8926c1e1e462cd86295a1a97091a6e24b03bfda4a7ab9e26a034a115632788154597baf7a83331a701fb519185a9f4ca09937b83aac
6
+ metadata.gz: 65485c117986f0a5e59e6a99b01b47a6eddcd026e00572d7128c8e4eefc05f8d2495620e161f61122e0b2d0484a247e3230a9cdef5d291ec7aa7bb972d7edadb
7
+ data.tar.gz: 707a89dba5ba744b4e78cea21484094ce9ed2c776c6a47a28197867c09881d97bef4053365aaffb132ca72bfefa11d0e67d85164d5e928fe24fa6a490652469e
@@ -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
6
+ version_regex = /\((\d+\.)?(\d+\.)?(\*|\d+)\)/
7
+ ios_version = params[:device][version_regex]
12
8
 
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")}")
9
+ if ios_version.nil?
10
+ sim = simulators.filter { |d| d.name == params[:device] }.max_by(&:os_version)
16
11
  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")
12
+ sim = simulators.detect { |d| "#{d.name} (#{d.os_version})" == params[:device] }
13
+ if sim.nil?
14
+ device_name = params[:device].sub(version_regex, '').strip
15
+ sh("xcrun simctl create '#{device_name}' '#{device_name}' 'iOS#{ios_version.delete('()')}'")
16
+ sim = simulators.detect { |d| "#{d.name} (#{d.os_version})" == params[:device] }
17
+ end
20
18
  end
19
+
20
+ if sim.nil?
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 params[:reset]
26
+ sh("xcrun simctl bootstatus #{sim.udid} -b")
27
+ UI.success("Simulator #{sim.name} (#{sim.os_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.2"
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.2
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