enumerate_it 1.2.7 → 1.2.8

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: 999a1820dce76bc226c194b24f5e33b4b2e6ebdd
4
- data.tar.gz: d5c6fea624ec0b72200b4bbdc99da85b52a0d288
3
+ metadata.gz: eb3b17b959d068dd3925d4301baad53e1f6f75b6
4
+ data.tar.gz: b86f23a236963e182d2d50396f4b5a9281a9fd2e
5
5
  SHA512:
6
- metadata.gz: 0bedc902cb5ec1325e300c56b9b387f067c4463d94209c7dfea18da8395268bd7ae90e1c4ba6833fcadaa8d645aedf972c253b11a559b674b47cfae907b88c7e
7
- data.tar.gz: 3b8b292ce65c7d7ffebc5f04f5089582b376681fd06df333b5f9fdaddc9b1e6efa703637a5be0ef8ba10c9d4f7992784223813fad40bd8955ba503b71003b43e
6
+ metadata.gz: 54acd99e960d73beaff448a8d12f8f28585c8989f11c0d552d6f591fb86150369d80b4c98cac4cd29ded5db29cbdde41d01322101fa7be0cc1b61d071d99ce25
7
+ data.tar.gz: f7cf10a4f74e27f8bc1cf2d43e2883f7e4509a904148c0839094653e5e6435e12f26551aafb95c720aaeb349f19159f9d575a6b9fa8dd3ca080948fb018befc7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enumerate_it (1.2.7)
4
+ enumerate_it (1.2.8)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -117,7 +117,7 @@ module EnumerateIt
117
117
  end
118
118
 
119
119
  def self.define_enumeration_constant(name, value)
120
- const_set name.to_s.underscore.upcase, value
120
+ const_set name.to_s.gsub(/-/, '_').upcase, value
121
121
  end
122
122
  end
123
123
  end
@@ -1,3 +1,3 @@
1
1
  module EnumerateIt
2
- VERSION = "1.2.7"
2
+ VERSION = "1.2.8"
3
3
  end
@@ -8,6 +8,10 @@ describe EnumerateIt::Base do
8
8
  end
9
9
  end
10
10
 
11
+ it "creates constants for camel case values" do
12
+ TestEnumerationWithCamelCase::IPHONE.should == 'iPhone'
13
+ end
14
+
11
15
  it "creates constants replacing its dashes with underscores" do
12
16
  TestEnumerationWithDash::PT_BR.should == 'pt-BR'
13
17
  end
@@ -37,6 +37,12 @@ class TestEnumerationWithDash < EnumerateIt::Base
37
37
  )
38
38
  end
39
39
 
40
+ class TestEnumerationWithCamelCase < EnumerateIt::Base
41
+ associate_values(
42
+ 'iPhone'
43
+ )
44
+ end
45
+
40
46
  class Foobar < EnumerateIt::Base
41
47
  associate_values(
42
48
  :bar => 'foo'
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.7
4
+ version: 1.2.8
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-05-24 00:00:00.000000000 Z
11
+ date: 2015-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport