simctl 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/simctl/list.rb +7 -1
- data/lib/simctl/runtime.rb +8 -0
- data/lib/simctl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac630b987ba9c0f46f26ced5fd5ec0d6487394bd
|
4
|
+
data.tar.gz: 07d80b1f7451dcc2dc21aae2e255ace702c4768f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d170e8e970ee62839dd7c082907cca67cd0c98f794bc2606cbeb22675fbaf412d5fa56bd5e787fc68e5e68ba5d1377c540d447dbd5c6c695bb538bf1912f186b
|
7
|
+
data.tar.gz: 79e93352a0b4aa486a5456c2896b32f5b894ce7dd1078daecc34eec184d095910b31386b9cb8fa747409d377448126ba83b4dca32b1f4e41a1a29744e6d99653
|
data/Gemfile.lock
CHANGED
data/lib/simctl/list.rb
CHANGED
@@ -8,10 +8,16 @@ module SimCtl
|
|
8
8
|
# @param filter [Hash] the filters that should be applied
|
9
9
|
# @return [Array] the filtered array.
|
10
10
|
def where(filter)
|
11
|
+
return self if filter.nil?
|
11
12
|
select do |item|
|
12
13
|
matches = true
|
13
14
|
filter.each do |key, value|
|
14
|
-
|
15
|
+
case value
|
16
|
+
when Regexp
|
17
|
+
matches &= item.send(key) =~ value
|
18
|
+
else
|
19
|
+
matches &= item.send(key) == value
|
20
|
+
end
|
15
21
|
end
|
16
22
|
matches
|
17
23
|
end
|
data/lib/simctl/runtime.rb
CHANGED
@@ -7,5 +7,13 @@ module SimCtl
|
|
7
7
|
def ==(other)
|
8
8
|
other.identifier == identifier
|
9
9
|
end
|
10
|
+
|
11
|
+
# Returns the latest available runtime
|
12
|
+
#
|
13
|
+
# @param name [String] type (ios, watchos, tvos)
|
14
|
+
# @return [SimCtl::Runtime] the latest available runtime
|
15
|
+
def self.latest(type)
|
16
|
+
SimCtl.list_runtimes.where(name: %r|#{type}|i).sort_by {|r| r.version}.reverse.first
|
17
|
+
end
|
10
18
|
end
|
11
19
|
end
|
data/lib/simctl/version.rb
CHANGED