fastlane-plugin-stream_actions 0.1.26 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0beeb883953224938534a7915ab9d09fc2ea3910734441ce85ba30cf5a1176a3
4
- data.tar.gz: 6a0b15ecbca915810ce149000e94accd287ba38350cf503f8af70d2cb2966fe3
3
+ metadata.gz: e3c68cd290b77976f04143da0e794c1847df520cfcaba6a5649319879202fd69
4
+ data.tar.gz: 753cdc1d6d20214fc4ea34689d04d7f641957330ee3ceac98660965de4fd48db
5
5
  SHA512:
6
- metadata.gz: 5e3521ceb6a20beda876d92c22ab41354d7f7348f3ae9d1a68bde0a57e08c4d150d223f96f802b59ee751ba023c7c541ccb32f7793bc2e2ed34319b41f534c8c
7
- data.tar.gz: b5790112fc6149e11f00878a0ae0f84ba319acabd28189fecb9cd0580e70d1567ecfb4d4241b4c39981080c5b847b0f191edbaf94a35d2b08c785eb42136da56
6
+ metadata.gz: e007bb35ff6c21140c3629dc4640e6b524cfe1645f6496454091bfbf27741dc808051dcf8fe628981c0a7c919be1ced5dff52fb88f48a37b3bfac3721894694f
7
+ data.tar.gz: d8f8c2602d1331f2b8aaf8926c1e1e462cd86295a1a97091a6e24b03bfda4a7ab9e26a034a115632788154597baf7a83331a701fb519185a9f4ca09937b83aac
@@ -0,0 +1,52 @@
1
+ module Fastlane
2
+ module Actions
3
+ class PrepareSimulatorAction < Action
4
+ def self.run(params)
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")}")
16
+ 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")
20
+ end
21
+ end
22
+
23
+ #####################################################
24
+ # @!group Documentation
25
+ #####################################################
26
+
27
+ def self.description
28
+ 'Prepares simulator for tests'
29
+ end
30
+
31
+ def self.available_options
32
+ [
33
+ FastlaneCore::ConfigItem.new(
34
+ key: :device,
35
+ description: 'Simulator name or name with version',
36
+ is_string: false
37
+ ),
38
+ FastlaneCore::ConfigItem.new(
39
+ key: :reset,
40
+ description: 'Reset simulator contents',
41
+ optional: true,
42
+ is_string: false
43
+ )
44
+ ]
45
+ end
46
+
47
+ def self.supported?(_platform)
48
+ true
49
+ end
50
+ end
51
+ end
52
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = "0.1.26"
3
+ VERSION = "0.2.1"
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.1.26
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-16 00:00:00.000000000 Z
11
+ date: 2023-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -235,6 +235,7 @@ files:
235
235
  - lib/fastlane/plugin/stream_actions/actions/custom_match.rb
236
236
  - lib/fastlane/plugin/stream_actions/actions/is_check_required.rb
237
237
  - lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb
238
+ - lib/fastlane/plugin/stream_actions/actions/prepare_simulator.rb
238
239
  - lib/fastlane/plugin/stream_actions/actions/read_changelog.rb
239
240
  - lib/fastlane/plugin/stream_actions/actions/release_ios_sdk.rb
240
241
  - lib/fastlane/plugin/stream_actions/actions/retrieve_xctest_names.rb