fourflusher 0.3.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/README.md +0 -4
- data/lib/fourflusher/find.rb +18 -5
- data/lib/fourflusher/version.rb +1 -1
- data/lib/fourflusher/xcodebuild.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e241d7369f92a28c82655eabe7a195a046367ff
|
4
|
+
data.tar.gz: bf4abf44b2c2727b442d7420eba20539c0764e3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f96dc7dd394a1918b4ad6f8f71ae30e2d0144a1d03a9dbb1b779ecf97ddd7dd23153b54e65ac2d6d76b0ce20d611eae15fe01b0ece69ac2b3243ce3b4ba3dfce
|
7
|
+
data.tar.gz: 010b434ef1d31a6c82e0a5bf1d57a9b5c2159dc34ff918f6c7df6b794717275e2cdac8e84501dde514832192dec2131388d900389a01e6a77b738ce5207c7356
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
data/lib/fourflusher/find.rb
CHANGED
@@ -6,7 +6,6 @@ module Fourflusher
|
|
6
6
|
class Simulator
|
7
7
|
attr_reader :id
|
8
8
|
attr_reader :name
|
9
|
-
attr_reader :os_name
|
10
9
|
attr_reader :os_version
|
11
10
|
|
12
11
|
def self.match(line, os_name, os_version)
|
@@ -15,6 +14,10 @@ module Fourflusher
|
|
15
14
|
sims
|
16
15
|
end
|
17
16
|
|
17
|
+
def os_name
|
18
|
+
@os_name.downcase.to_sym
|
19
|
+
end
|
20
|
+
|
18
21
|
def compatible?(other_version)
|
19
22
|
other_version <= os_version
|
20
23
|
end
|
@@ -60,11 +63,11 @@ module Fourflusher
|
|
60
63
|
@os_regex = /^-- (?<os_name>.*?) (?<os_version>[0-9][0-9]?\.[0-9]) --$/
|
61
64
|
end
|
62
65
|
|
63
|
-
def simulator(filter, minimum_version = '1.0')
|
64
|
-
usable_simulators(filter, minimum_version).first
|
66
|
+
def simulator(filter, os_name = :ios, minimum_version = '1.0')
|
67
|
+
usable_simulators(filter, os_name, minimum_version).first
|
65
68
|
end
|
66
69
|
|
67
|
-
def usable_simulators(filter = nil, minimum_version = '1.0')
|
70
|
+
def usable_simulators(filter = nil, os = :ios, minimum_version = '1.0')
|
68
71
|
os_name = ''
|
69
72
|
os_version = ''
|
70
73
|
sims = []
|
@@ -77,9 +80,19 @@ module Fourflusher
|
|
77
80
|
sims += Simulator.match(line, os_name, os_version)
|
78
81
|
end
|
79
82
|
|
83
|
+
oses = sims.map(&:os_name).uniq
|
84
|
+
os = os.downcase.to_sym
|
85
|
+
fail "Invalid OS `#{os}`, valid values are #{oses.join(', ')}" unless oses.include?(os)
|
86
|
+
|
80
87
|
return sims if filter.nil?
|
81
88
|
minimum_version = Gem::Version.new(minimum_version)
|
82
|
-
sims.select { |sim| sim.
|
89
|
+
sims = sims.select { |sim| sim.os_name == os && sim.compatible?(minimum_version) }
|
90
|
+
|
91
|
+
return [sims.first] if filter == :oldest
|
92
|
+
|
93
|
+
found_sims = sims.select { |sim| sim.name == filter }
|
94
|
+
return found_sims if found_sims.count > 0
|
95
|
+
sims.select { |sim| sim.name.start_with?(filter) }
|
83
96
|
end
|
84
97
|
end
|
85
98
|
end
|
data/lib/fourflusher/version.rb
CHANGED
@@ -3,8 +3,8 @@ require 'fourflusher/find'
|
|
3
3
|
module Fourflusher
|
4
4
|
# Executes `simctl` commands
|
5
5
|
class SimControl
|
6
|
-
def destination(filter, minimum_version = '1.0')
|
7
|
-
sim = simulator(filter, minimum_version)
|
6
|
+
def destination(filter, os = :ios, minimum_version = '1.0')
|
7
|
+
sim = simulator(filter, os, minimum_version)
|
8
8
|
fail "Simulator #{filter} is not available." if sim.nil?
|
9
9
|
['-destination', "id=#{sim.id}"]
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fourflusher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Bügling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|