scan 0.5.1 → 0.5.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
  SHA1:
3
- metadata.gz: 94178c2aa910d15be0704ae7fe9ce73aeb5a4bfe
4
- data.tar.gz: 923dadf5c7e12b39cf3f659d0a44021bcb166c87
3
+ metadata.gz: e45976649b2e9fd5eb6c7dec135c9972d14fc49a
4
+ data.tar.gz: a750b23c56d56e7918c200f242ba3452cac5bcaa
5
5
  SHA512:
6
- metadata.gz: 9fd6f4c7a540e60ed9b2197e08ba1366101029958912d97a2d81d30fb4f6c40b503167e34a32106259a13c644372dabffd0b7629be6fba342de6f4fb59849d3d
7
- data.tar.gz: e57928817765f495f16963aaaad21a70a1eb0c1e674edf8ab5b8aef89dbf7bd408ccdd3d682de7c0c72b2320f50c667181b98af5b13f92a906cd3a7d0be93400
6
+ metadata.gz: aa2e8fbdc5593c33e9beb4fabb2cec95dbb9a5482a7584fce1c07800eb415bee302a3e77318ea2965316662a9fdd695fdbc76945be2cd6c52771f3fe75328071
7
+ data.tar.gz: 1474af4717f5c30f7d10fadd0cce22a3d678728f0e5ad63a1aad05c7add87781de40071c679511da125bbf1d2966e514ee15c8962211c2c2ab3e71d3a334176c
@@ -27,6 +27,15 @@ module Scan
27
27
  return config
28
28
  end
29
29
 
30
+ def self.filter_simulators(simulators, deployment_target)
31
+ # Filter out any simulators that are not the same major and minor version of our deployment target
32
+ deployment_target_version = Gem::Version.new(deployment_target)
33
+ simulators.select do |s|
34
+ sim_version = Gem::Version.new(s.ios_version)
35
+ (sim_version >= deployment_target_version)
36
+ end
37
+ end
38
+
30
39
  def self.default_device_ios
31
40
  config = Scan.config
32
41
 
@@ -47,15 +56,10 @@ module Scan
47
56
 
48
57
  sims = FastlaneCore::Simulator.all
49
58
  xcode_target = Scan.project.build_settings(key: "IPHONEOS_DEPLOYMENT_TARGET")
50
-
51
- # Filter out any simulators that are not the same major version of our deployment target
52
- if xcode_target.to_s.length > 0
53
- min_target = xcode_target.split(".").first.to_i
54
- sims = sims.select { |s| s.ios_version.to_i >= min_target }
55
- end
59
+ sims = filter_simulators(sims, xcode_target)
56
60
 
57
61
  # An iPhone 5s is reasonable small and useful for tests
58
- found = sims.find { |d| d.name == "iPhone 5s" }
62
+ found = sims.detect { |d| d.name == "iPhone 5s" }
59
63
  found ||= sims.first # anything is better than nothing
60
64
 
61
65
  Scan.device = found
@@ -83,15 +87,10 @@ module Scan
83
87
 
84
88
  sims = FastlaneCore::SimulatorTV.all
85
89
  xcode_target = Scan.project.build_settings(key: "TVOS_DEPLOYMENT_TARGET")
86
-
87
- # Filter out any simulators that are not the same major version of our deployment target
88
- if xcode_target.to_s.length > 0
89
- min_target = xcode_target.split(".").first.to_i
90
- sims = sims.select { |s| s.ios_version.to_i >= min_target }
91
- end
90
+ sims = filter_simulators(sims, xcode_target)
92
91
 
93
92
  # Apple TV 1080p is useful for tests
94
- found = sims.find { |d| d.name == "Apple TV 1080p" }
93
+ found = sims.detect { |d| d.name == "Apple TV 1080p" }
95
94
  found ||= sims.first # anything is better than nothing
96
95
 
97
96
  Scan.device = found
@@ -1,4 +1,4 @@
1
1
  module Scan
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  DESCRIPTION = "The easiest way to run tests of your iOS and Mac app"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
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-02-25 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core