enumerate_it 1.2.5 → 1.2.6

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: 55c9991c5866408583f6c824a30564be4c25ac16
4
- data.tar.gz: 553a8914d8ecb9c4db2b2402bdc1cf26f8b2ecb9
3
+ metadata.gz: fcfdd7eb8e16a788b9dc74ea13cafee13de7b263
4
+ data.tar.gz: 5fc064e8922178d167c091ca28a0de43cb1d1d6c
5
5
  SHA512:
6
- metadata.gz: 4488bdb747ccb40dc21feccf8bc6cccf41eb782cd05519e9c71c0ebb232bcd14a8026300c0b373c12d4e8f4c0ebcc30e57bbff047e45fc609b7dbe4490befc95
7
- data.tar.gz: 31aae52d45cd1b8adaef5941283fd2d824aacc28f2db2b71e76d15e3c2e578e7b1348ca891bbbbd4ff90dda318be92cb271c943df51f826955e21ed26e3508e2
6
+ metadata.gz: 39f105929365d7bb2f2adce070e85c7e0f77a92ecac4cadf4f78b3013e071922f5bd24c857740e7df53782f7462655eb7dbba4bed6ce99bfd5e0f9719953e6fb
7
+ data.tar.gz: df0f7c1e3a39cf6ac4e66153b44e7b5d53655b570fc6ada41794ef09278ac2fa7e6837bc411dd9bdd8f18062a0309dafe557fb5d1e3f9e94473b3d91a205a2e3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enumerate_it (1.2.5)
4
+ enumerate_it (1.2.6)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -66,6 +66,7 @@ module EnumerateIt
66
66
  end
67
67
 
68
68
  def self.value_from_key(key)
69
+ return if key.nil?
69
70
  (enumeration[key.to_sym] || []).first
70
71
  end
71
72
 
@@ -1,3 +1,3 @@
1
1
  module EnumerateIt
2
- VERSION = "1.2.5"
2
+ VERSION = "1.2.6"
3
3
  end
@@ -127,6 +127,10 @@ describe EnumerateIt::Base do
127
127
  it "returns nil when the key does not exist in the enumeration" do
128
128
  TestEnumeration.value_from_key("wrong").should be_nil
129
129
  end
130
+
131
+ it "returns nil when the given value is nil" do
132
+ TestEnumeration.value_from_key(nil).should be_nil
133
+ end
130
134
  end
131
135
 
132
136
  describe ".keys" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enumerate_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cássio Marques
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-10 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport