snapshot 1.14.0 → 1.15.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: 507d1a24a86968c2207b6b86b7f8d5dc855147c1
4
- data.tar.gz: d96ff57e41e2ba04fe71820d84c3386862de0496
3
+ metadata.gz: 2ab0c8a90c25504323f9cb4e593420b2398cc4a2
4
+ data.tar.gz: eaa725687e667a1f60eff7fa461086edf805d9a7
5
5
  SHA512:
6
- metadata.gz: 9fdcb712a94aa20a9dddc6d81f5b9c66992e63566d91016b348764a6c65ffad5a962d2ef7433552cbcce18f96efa1c0a565468f7e5aad5c2ff478e3d099137c9
7
- data.tar.gz: 55eb482ca24372840bc655560cec79e4f2db0e2fb579891050912ceecb9ffb53e6e3c40bc3117f54f46d1eee01fbe558c5ece3789efe2eaf267aab9c306cea34
6
+ metadata.gz: f84ab4ea8dbcbadbc5438caa9eb9527817b4eaf44a8388ed56c0eb0bd5a497937318cb3e8742af1358e6502a61c1c1a1bfbf40883235d32baa5d8add79b8004b
7
+ data.tar.gz: 18447383ca6317df228bcbce85c12e2ce999d69093ed28bac4e2cdb8412ad0468652cc3dcc43a96c3eb96972b0c789157fb9bcd136bcc2259f0879ba8c4fc290
@@ -203,7 +203,7 @@ module Snapshot
203
203
 
204
204
  def uninstall_app(device_type)
205
205
  UI.verbose "Uninstalling app '#{Snapshot.config[:app_identifier]}' from #{device_type}..."
206
- Snapshot.config[:app_identifier] ||= ask("App Identifier: ")
206
+ Snapshot.config[:app_identifier] ||= UI.input("App Identifier: ")
207
207
  device_udid = TestCommandGenerator.device_udid(device_type)
208
208
 
209
209
  UI.message "Launch Simulator #{device_type}"
@@ -64,7 +64,7 @@ module Snapshot
64
64
  ["| tee #{xcodebuild_log_path.shellescape} | xcpretty #{Snapshot.config[:xcpretty_args]}"]
65
65
  end
66
66
 
67
- def find_device(device_name, os_version)
67
+ def find_device(device_name, os_version = Snapshot.config[:ios_version])
68
68
  # We might get this error message
69
69
  # > The requested device could not be found because multiple devices matched the request.
70
70
  #
@@ -72,10 +72,13 @@ module Snapshot
72
72
  # { platform:iOS Simulator, id:1685B071-AFB2-4DC1-BE29-8370BA4A6EBD, OS:9.0, name:iPhone 5 }
73
73
  # { platform:iOS Simulator, id:A141F23B-96B3-491A-8949-813B376C28A7, OS:9.0, name:iPhone 5 }
74
74
  #
75
-
76
- FastlaneCore::DeviceManager.simulators.find do |sim|
77
- sim.name.strip == device_name.strip and sim.os_version == os_version
78
- end
75
+ simulators = FastlaneCore::DeviceManager.simulators
76
+ # Sort devices with matching names by OS version, largest first, so that we can
77
+ # pick the device with the newest OS in case an exact OS match is not available
78
+ name_matches = simulators.find_all { |sim| sim.name.strip == device_name.strip }
79
+ .sort_by { |sim| Gem::Version.new(sim.os_version) }
80
+ .reverse
81
+ name_matches.find { |sim| sim.os_version == os_version } || name_matches.first
79
82
  end
80
83
 
81
84
  def device_udid(device_name, os_version = Snapshot.config[:ios_version])
@@ -92,6 +95,8 @@ module Snapshot
92
95
  if device.nil?
93
96
  UI.user_error!("No device found named '#{device_name}' for version '#{os_version}'")
94
97
  return
98
+ elsif device.os_version != os_version
99
+ UI.important("Using device named '#{device_name}' with version '#{device.os_version}' because no match was found for version '#{os_version}'")
95
100
  end
96
101
  value = "platform=#{os} Simulator,id=#{device.udid},OS=#{os_version}"
97
102
 
@@ -1,4 +1,4 @@
1
1
  module Snapshot
2
- VERSION = "1.14.0".freeze
2
+ VERSION = "1.15.0".freeze
3
3
  DESCRIPTION = "Automate taking localized screenshots of your iOS app on every device"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.0
4
+ version: 1.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-29 00:00:00.000000000 Z
11
+ date: 2016-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastimage
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.50.3
33
+ version: 0.52.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 1.0.0
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.50.3
43
+ version: 0.52.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.0.0