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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66e717c3577951bc8852113b1608059aa2a97a3d
4
- data.tar.gz: f38b7984116c716d0dd23873e35feb4060fea914
3
+ metadata.gz: 073e00b38b71a11f7152e757e8999291f92d50e8
4
+ data.tar.gz: dd38d826d08a4e5231649bd3b0eab15c0b63e6f7
5
5
  SHA512:
6
- metadata.gz: 8e080caef68f3343f750c59781ac1d4491ec6549a75c1494543303ef025cbe7e696efd4667cb7c06a457a56689b733b2669599798ce24aa3a3a89e8badcace27
7
- data.tar.gz: eb15a6030a0279f87f7db9dbf91073dee0fe53e92e15e48a5c3cff2de59413086f1df415e6bf4409bc9f578ebb0e713e0607010825ab564001f97194aa40bee7
6
+ metadata.gz: 9ca79636e73b07ccdacefa02a0a4c4fc1ca0ac89305b0f1f4e74d832bbaadda8030602055b1d93c0f00c498445307b6db5614d27416a53e50a7b7836656c8c09
7
+ data.tar.gz: 860e3b7d8faf357326e6ba80fcbe16ddd9183fb1e35051b186e381d19fc20f725c3efdcd2a4a788844664bfccf9d7dbacd628ea705f98d28ba8c96f8b2bec1d1
data/.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "object_selector"
3
- spec.version = "1.0.0"
3
+ spec.version = "1.0.1"
4
4
  spec.authors = ["Charles Mulder"]
5
5
  spec.email = ["charles.mulder@hetzner.co.za"]
6
6
 
data/Gemfile CHANGED
@@ -3,4 +3,5 @@ gemspec
3
3
 
4
4
  group :test do
5
5
  gem 'rspec', '~> 3.5'
6
+ gem 'faker', '~> 1.6', '>= 1.6.3'
6
7
  end
data/Gemfile.lock CHANGED
@@ -1,12 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- object_selector (0.0.2)
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.each { |rule|
23
+ object = @rules.map { |rule|
24
24
  break rule[:object] if rule[:regex].match(value)
25
25
  }
26
- raise ObjectSelector::RegexRuleList::NoMatchError, 'No rules matched' if object.is_a?(Array) and object.empty?
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.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-17 00:00:00.000000000 Z
11
+ date: 2017-02-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: