enum-x 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: b8f9f8f44090850e7af6d54f9d6ed30816053a25
4
- data.tar.gz: be58187f64fc5fa9b350597619bc5b367671dd4f
3
+ metadata.gz: 65ef2227ed4dbfc2f73f239e0457ffe9fb6a4909
4
+ data.tar.gz: 121052685c06ea6b5889797f4e07888cbad010f1
5
5
  SHA512:
6
- metadata.gz: 4633fcb4bd2f51bf0d751a2140fee3c963bffecfaf547aa73b409c206295e46979fcd0507ef25a32274255c56811fce08d4d4c8c741a81e4d8ac65cc0248f67a
7
- data.tar.gz: ac105833237ace3f033fd259fe1c506857378604219d70a355e0c7fb25696ae08a7480f181d387a03e462d82383978b425fcf7ff0f38e2c51d1139fe37027c48
6
+ metadata.gz: f3f9ae905079f8d12314c636b5567bec33126e64a7a40a5970bf7d236327cbe0d90123665ab0f6245adbba2c2f1891e2fb5981b115c8cf705e9b41bfdc03c788
7
+ data.tar.gz: b39027d23203ca612e7cad2562f8dceca054145bcbf7c055bc2413dc4f0243fc6928c697945c0c684c6625628d89149eba8d3e9b7502357443bf58878cabaa47
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ script: bundle exec rake
2
+ rvm:
3
+ - 2.0.0
4
+ branches:
5
+ only:
6
+ - master
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enum-x (1.0.0)
4
+ enum-x (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/enum_x/value.rb CHANGED
@@ -88,7 +88,7 @@ class EnumX
88
88
  def to_f; value.to_f end
89
89
 
90
90
  def respond_to?(method)
91
- if method =~ /^to_/ && !%w[ to_int to_a to_ary ].include?(method.to_s)
91
+ if method =~ /^to_/ && !%w[ to_int to_a to_ary to_hash ].include?(method.to_s)
92
92
  true
93
93
  elsif method =~ /\?$/ && enum.values.include?($`)
94
94
  true
@@ -98,7 +98,7 @@ class EnumX
98
98
  end
99
99
 
100
100
  def method_missing(method, *args, &block)
101
- if method =~ /^to_/ && !%w[ to_int to_a to_ary ].include?(method.to_s)
101
+ if method =~ /^to_/ && !%w[ to_int to_a to_ary to_hash ].include?(method.to_s)
102
102
  @formats[$'] || value
103
103
  elsif method =~ /\?$/
104
104
  value = $`
@@ -1,3 +1,3 @@
1
1
  class EnumX
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
data/spec/enum_x_spec.rb CHANGED
@@ -224,6 +224,10 @@ describe EnumX do
224
224
  specify { expect(simple_value.to_number).to eql('one') }
225
225
  specify { expect(simple_value.to_xml).to eql('one') }
226
226
  specify { expect(simple_value.to_json).to eql('"one"') }
227
+
228
+ specify { expect(simple_value).not_to respond_to(:to_hash) }
229
+ specify { expect{simple_value.to_hash}.to raise_error(NoMethodError) }
230
+
227
231
  specify { expect(simple_value.hash).to eql('one'.hash) }
228
232
 
229
233
  specify { expect(complex_value.value).to eql('three') }
@@ -233,6 +237,7 @@ describe EnumX do
233
237
  specify { expect(complex_value.to_number).to eql('3') }
234
238
  specify { expect(complex_value.to_xml).to eql('three') }
235
239
  specify { expect(complex_value.to_json).to eql('"three"') }
240
+
236
241
  specify { expect(complex_value.hash).to eql('three'.hash) }
237
242
 
238
243
  describe 'duplication' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum-x
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
  - Joost Lubach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-16 00:00:00.000000000 Z
11
+ date: 2013-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,6 +90,7 @@ files:
90
90
  - .gitignore
91
91
  - .ruby-gemset
92
92
  - .ruby-version
93
+ - .travis.yml
93
94
  - CHANGELOG.md
94
95
  - Gemfile
95
96
  - Gemfile.lock