object_selector 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gemspec +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +5 -1
- data/lib/object_selector/provider/regex_rule_list.rb +2 -2
- 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: 073e00b38b71a11f7152e757e8999291f92d50e8
|
4
|
+
data.tar.gz: dd38d826d08a4e5231649bd3b0eab15c0b63e6f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ca79636e73b07ccdacefa02a0a4c4fc1ca0ac89305b0f1f4e74d832bbaadda8030602055b1d93c0f00c498445307b6db5614d27416a53e50a7b7836656c8c09
|
7
|
+
data.tar.gz: 860e3b7d8faf357326e6ba80fcbe16ddd9183fb1e35051b186e381d19fc20f725c3efdcd2a4a788844664bfccf9d7dbacd628ea705f98d28ba8c96f8b2bec1d1
|
data/.gemspec
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
object_selector (0.0
|
4
|
+
object_selector (1.0.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
diff-lcs (1.3)
|
10
|
+
faker (1.7.3)
|
11
|
+
i18n (~> 0.5)
|
12
|
+
i18n (0.8.0)
|
10
13
|
rspec (3.5.0)
|
11
14
|
rspec-core (~> 3.5.0)
|
12
15
|
rspec-expectations (~> 3.5.0)
|
@@ -25,6 +28,7 @@ PLATFORMS
|
|
25
28
|
ruby
|
26
29
|
|
27
30
|
DEPENDENCIES
|
31
|
+
faker (~> 1.6, >= 1.6.3)
|
28
32
|
object_selector!
|
29
33
|
rspec (~> 3.5)
|
30
34
|
|
@@ -20,10 +20,10 @@ module ObjectSelector
|
|
20
20
|
# @raise [ObjectSelector::Error::NoMatchError]
|
21
21
|
##
|
22
22
|
def select(value)
|
23
|
-
object = @rules.
|
23
|
+
object = @rules.map { |rule|
|
24
24
|
break rule[:object] if rule[:regex].match(value)
|
25
25
|
}
|
26
|
-
raise ObjectSelector::
|
26
|
+
raise ObjectSelector::Error::NoMatchError, 'No rules matched' if object.is_a?(Array) and object.all? &:nil?
|
27
27
|
return object
|
28
28
|
end
|
29
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: object_selector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Mulder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|