inum 5.1.0 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/inum/base.rb +2 -2
- data/lib/inum/version.rb +1 -1
- data/spec/inum/base_spec.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: 92efa81161155f336cb84f1e2f6ae43dfa7e3dbe
|
4
|
+
data.tar.gz: f9e80cd38edae6fca9d49b70561d90833addec3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bc684c912cd842f6e54b0f4f7a1591e33949a2681ef703f4266ce6c2c3c8dbb96e872df1794a6d9870832cf1ec00569287b11e327484778c10a00580bd832d7
|
7
|
+
data.tar.gz: ea2395a6da2f5c111412726a62c1f1af97a90d370875d725f6c98c3e5326dbf0fa397e5f886df951389f34b1f2021c9c86ba476236dde87eb6dd71c48639229b
|
data/README.md
CHANGED
@@ -40,6 +40,7 @@ How to use Enum(Inum).
|
|
40
40
|
p AnimeTypes::EVANGELION.label # => :EVANGELION
|
41
41
|
p AnimeTypes::EVANGELION.to_s # => "EVANGELION"
|
42
42
|
p AnimeTypes::EVANGELION.downcase # => "evangelion"
|
43
|
+
p AnimeTypes::EVANGELION.underscore # => "evangelion"
|
43
44
|
p AnimeTypes::EVANGELION.upcase # => "EVANGELION"
|
44
45
|
p AnimeTypes::EVANGELION.value # => 0 (can use to_i.)
|
45
46
|
p AnimeTypes::EVANGELION.translate # => エヴァンゲリオン (I18n.t will be called with `anime_types.evangelion`.)
|
data/lib/inum/base.rb
CHANGED
@@ -179,8 +179,8 @@ module Inum
|
|
179
179
|
if /^\d+$/.match(object)
|
180
180
|
parse(object.to_i)
|
181
181
|
else
|
182
|
-
|
183
|
-
find {|e| e.
|
182
|
+
underscore = object.underscore
|
183
|
+
find {|e| e.underscore == underscore}
|
184
184
|
end
|
185
185
|
when Symbol
|
186
186
|
parse(object.to_s)
|
data/lib/inum/version.rb
CHANGED
data/spec/inum/base_spec.rb
CHANGED
@@ -299,14 +299,14 @@ describe Inum::Base do
|
|
299
299
|
let(:destination) { Anime::BakuOn }
|
300
300
|
|
301
301
|
context 'When source is string' do
|
302
|
-
let(:source) { '
|
302
|
+
let(:source) { 'baku_on' }
|
303
303
|
it 'Return inum.' do
|
304
304
|
subject
|
305
305
|
end
|
306
306
|
end
|
307
307
|
|
308
308
|
context 'When source is symbol' do
|
309
|
-
let(:source) { :
|
309
|
+
let(:source) { :baku_on }
|
310
310
|
it 'Return inum.' do
|
311
311
|
subject
|
312
312
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alfa-jpn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|