fourflusher 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fourflusher/find.rb +11 -5
- data/lib/fourflusher/version.rb +1 -1
- 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: 3daec683248c7e25334b3d3b27784440c9d228ab
|
4
|
+
data.tar.gz: 4222dea58e1f34e25af99b4ac77072b6818e9d49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b17adb522493ab65b9840f7dc1d1f765308f530d9ee84c92b7bcf51037a60d103c64be6e611100bdcb7d331d50ef05eefa4d01e65e369d57462390f10a575be9
|
7
|
+
data.tar.gz: 2bee43e31e70dfa845dc4d131b7a7701cd5f810dc3c287ecee37e662127dff0cb38ff11380185c61ac619138c00ca66d5749c6277ed12cf701eada479ac9344c
|
data/lib/fourflusher/find.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fourflusher/simctl'
|
2
|
+
require 'rubygems/version'
|
2
3
|
|
3
4
|
module Fourflusher
|
4
5
|
# Metadata about an installed Xcode simulator
|
@@ -10,10 +11,14 @@ module Fourflusher
|
|
10
11
|
|
11
12
|
def self.match(line, os_name, os_version)
|
12
13
|
sims = []
|
13
|
-
@@sim_regex.match(line) { |m| sims << Simulator.new(m, os_name, os_version) }
|
14
|
+
@@sim_regex.match(line) { |m| sims << Simulator.new(m, os_name, Gem::Version.new(os_version)) }
|
14
15
|
sims
|
15
16
|
end
|
16
17
|
|
18
|
+
def compatible?(other_version)
|
19
|
+
other_version <= os_version
|
20
|
+
end
|
21
|
+
|
17
22
|
def to_s
|
18
23
|
"#{@name} (#{@id}) - #{@os_name} #{@os_version}"
|
19
24
|
end
|
@@ -55,11 +60,11 @@ module Fourflusher
|
|
55
60
|
@os_regex = /^-- (?<os_name>.*?) (?<os_version>[0-9].[0-9]) --$/
|
56
61
|
end
|
57
62
|
|
58
|
-
def simulator(filter)
|
59
|
-
usable_simulators(filter).first
|
63
|
+
def simulator(filter, minimum_version = '1.0')
|
64
|
+
usable_simulators(filter, minimum_version).first
|
60
65
|
end
|
61
66
|
|
62
|
-
def usable_simulators(filter = nil)
|
67
|
+
def usable_simulators(filter = nil, minimum_version = '1.0')
|
63
68
|
os_name = ''
|
64
69
|
os_version = ''
|
65
70
|
sims = []
|
@@ -73,7 +78,8 @@ module Fourflusher
|
|
73
78
|
end
|
74
79
|
|
75
80
|
return sims if filter.nil?
|
76
|
-
|
81
|
+
minimum_version = Gem::Version.new(minimum_version)
|
82
|
+
sims.select { |sim| sim.name == filter && sim.compatible?(minimum_version) }
|
77
83
|
end
|
78
84
|
end
|
79
85
|
end
|
data/lib/fourflusher/version.rb
CHANGED
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: 0.2.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: 2015-12-
|
11
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|