cfbundle 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/cfbundle/bundle.rb +6 -4
- data/lib/cfbundle/resource.rb +8 -4
- data/lib/cfbundle/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: cb47f6e2b1fd4c7f0b652e8553ddb2ee9feac678
|
4
|
+
data.tar.gz: 6eebb9c7b2ecd6a01befe1bf2cd115a2947aa8ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b13a0b2c376174803a397f94b9a6264c46680e0d50f0234c0335fd5f3858d357c5105ab42f85623cf4dde6e808c70181cacf0a9a2884b40c96f9473db42afa96
|
7
|
+
data.tar.gz: 1ce00b3e0ded6e48dfee03d50cf8d7b7a15832be5ceaa369fcaf23c0ed37105349a63714e0cbbffb290e9cf36028f99db5b7f3ec5b62096ab1edaab4ba7631a3
|
data/lib/cfbundle/bundle.rb
CHANGED
@@ -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
|
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
|
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?,
|
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
|
data/lib/cfbundle/resource.rb
CHANGED
@@ -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
|
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?
|
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
|
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.
|
data/lib/cfbundle/version.rb
CHANGED