cfbundle 0.1.0 → 0.2.0

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: 34fbdac8d95981c1ee22c2cb3b57a5f80d1cd975
4
- data.tar.gz: 85f292ed9c14e869a69b2d01c3238765fe29f5ae
3
+ metadata.gz: cb47f6e2b1fd4c7f0b652e8553ddb2ee9feac678
4
+ data.tar.gz: 6eebb9c7b2ecd6a01befe1bf2cd115a2947aa8ac
5
5
  SHA512:
6
- metadata.gz: d162902ed081d3c2cc34d108e0d881846333eec364c9daa34208477c3c66f0f4e1f08389e008272dea1487570f60562ce71f6a515218ccaa4169e5953d59c104
7
- data.tar.gz: b8fbc74c34d59c06bf626f744517c74419773c4732fe01b49e9d5e44a8569bfb7219380e7d42c8fb414bd0f87762546d62940b96e9298b100923a1135e0ac143
6
+ metadata.gz: b13a0b2c376174803a397f94b9a6264c46680e0d50f0234c0335fd5f3858d357c5105ab42f85623cf4dde6e808c70181cacf0a9a2884b40c96f9473db42afa96
7
+ data.tar.gz: 1ce00b3e0ded6e48dfee03d50cf8d7b7a15832be5ceaa369fcaf23c0ed37105349a63714e0cbbffb290e9cf36028f99db5b7f3ec5b62096ab1edaab4ba7631a3
@@ -179,7 +179,8 @@ module CFBundle
179
179
 
180
180
  # Returns the first {Resource} object that matches the specified parameters.
181
181
  #
182
- # @param name [String?] The name to match or +nil+ to match any name.
182
+ # @param name [String?, Rexgep?] The name to match or +nil+ to match any
183
+ # name.
183
184
  # @param extension [String?] The extension to match or +nil+ to match any
184
185
  # extension.
185
186
  # @param subdirectory [String?] The name of the bundle subdirectory
@@ -204,13 +205,14 @@ module CFBundle
204
205
 
205
206
  # Returns all the {Resource} objects that matches the specified parameters.
206
207
  #
207
- # @param name [String?] The name to match or +nil+ to match any name.
208
+ # @param name [String?, Rexgep?] The name to match or +nil+ to match any
209
+ # name.
208
210
  # @param extension [String?] The extension to match or +nil+ to match any
209
211
  # extension.
210
212
  # @param subdirectory [String?] The name of the bundle subdirectory to
211
213
  # search.
212
- # @param localization [String?, Array] The language identifier for the
213
- # localization.
214
+ # @param localization [String?, Symbol?] A language identifier to restrict
215
+ # the search to a specific localization.
214
216
  # @param preferred_languages [Array] An array of strings (or symbols)
215
217
  # corresponding to a user's preferred languages.
216
218
  # @param product [String?] The product to match or +nil+ to match any
@@ -35,7 +35,8 @@ module CFBundle
35
35
  # Enumerates the resources in a bundle that match the specified parameters.
36
36
  #
37
37
  # @param bundle [Bundle] The bundle that contains the resources.
38
- # @param name [String?] The name to match or +nil+ to match any name.
38
+ # @param name [String?, Rexgep?] The name to match or +nil+ to match any
39
+ # name.
39
40
  # @param extension [String?] The extension to match or +nil+ to match any
40
41
  # extension.
41
42
  # @param localization [String?, Symbol?] A language identifier to restrict
@@ -72,7 +73,9 @@ module CFBundle
72
73
  end
73
74
 
74
75
  def name_match?(predicate)
75
- predicate.name.nil? || @name == predicate.name
76
+ return true if predicate.name.nil?
77
+ return predicate.name.match? @name if predicate.name.is_a?(Regexp)
78
+ predicate.name == @name
76
79
  end
77
80
 
78
81
  def extension_match?(predicate)
@@ -153,7 +156,7 @@ module CFBundle
153
156
  # the resources of a bundle.
154
157
  class Predicate
155
158
  # Returns the name to match or +nil+ to match any name.
156
- # @return [String?]
159
+ # @return [String?, Regexp?]
157
160
  attr_reader :name
158
161
 
159
162
  # Returns the extension to match or +nil+ to match any extension.
@@ -164,7 +167,8 @@ module CFBundle
164
167
  # @return [String]
165
168
  attr_reader :product
166
169
 
167
- # @param name [String?] The name to match or +nil+ to match any name.
170
+ # @param name [String?, Rexgep?] The name to match or +nil+ to match any
171
+ # name.
168
172
  # @param extension [String?] The extension to match or +nil+ to match any
169
173
  # extension.
170
174
  # @param product [String?] The product to match.
@@ -1,3 +1,3 @@
1
1
  module CFBundle
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfbundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Bachschmidt