simctl 1.2.2 → 1.2.3

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: c64181bce6bd44757cc40ad80d530367182e500f
4
- data.tar.gz: b5080f220c9c228e1365329144d272cd2adc2f02
3
+ metadata.gz: ac630b987ba9c0f46f26ced5fd5ec0d6487394bd
4
+ data.tar.gz: 07d80b1f7451dcc2dc21aae2e255ace702c4768f
5
5
  SHA512:
6
- metadata.gz: 5041926ee0fa6300f4536298a2e96bc89a88b131deeee29fcc7f71ae304dcb43ac1752caea923e99f641a2f3f02f7943878ec2c4eab045840a183956fa0b41a8
7
- data.tar.gz: b49e71bee949ded4f5798a1b212122cbf2d5735ef66a6e493d93617310d163f41b3cd8bbbad83a7d7a59c64f7eafe18a954fba16d057e56f58391b76d9b0c067
6
+ metadata.gz: d170e8e970ee62839dd7c082907cca67cd0c98f794bc2606cbeb22675fbaf412d5fa56bd5e787fc68e5e68ba5d1377c540d447dbd5c6c695bb538bf1912f186b
7
+ data.tar.gz: 79e93352a0b4aa486a5456c2896b32f5b894ce7dd1078daecc34eec184d095910b31386b9cb8fa747409d377448126ba83b4dca32b1f4e41a1a29744e6d99653
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simctl (1.2.2)
4
+ simctl (1.2.3)
5
5
  CFPropertyList
6
6
 
7
7
  GEM
@@ -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
- matches &= item.send(key) == value
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module SimCtl
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Plunien