hashr 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hashr (0.0.15)
4
+ hashr (0.0.16)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -10,6 +10,7 @@ GEM
10
10
  test_declarative (0.0.5)
11
11
 
12
12
  PLATFORMS
13
+ java
13
14
  ruby
14
15
 
15
16
  DEPENDENCIES
@@ -46,7 +46,7 @@ class Hashr < Hash
46
46
  end
47
47
 
48
48
  def []=(key, value)
49
- super(key, value.is_a?(Hash) ? self.class.new(value, {}) : value)
49
+ super(key.to_sym, value.is_a?(Hash) ? self.class.new(value, {}) : value)
50
50
  end
51
51
 
52
52
  def respond_to?(name)
@@ -1,3 +1,3 @@
1
1
  class Hashr < Hash
2
- VERSION = '0.0.16'
2
+ VERSION = '0.0.17'
3
3
  end
@@ -77,6 +77,18 @@ class HashrTest < Test::Unit::TestCase
77
77
  assert_equal 'foo', hashr.foo
78
78
  end
79
79
 
80
+ test 'method using a string key works' do
81
+ hashr = Hashr.new
82
+ hashr['foo'] = 'foo'
83
+ assert_equal 'foo', hashr.foo
84
+ end
85
+
86
+ test 'using a symbol key works' do
87
+ hashr = Hashr.new
88
+ hashr[:foo] = 'foo'
89
+ assert_equal 'foo', hashr.foo
90
+ end
91
+
80
92
  test 'defining defaults' do
81
93
  klass = Class.new(Hashr) do
82
94
  define :foo => 'foo', :bar => { :baz => 'baz' }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-29 00:00:00.000000000Z
12
+ date: 2011-11-18 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70154104357900 !ruby/object:Gem::Requirement
16
+ requirement: &70265474354120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70154104357900
24
+ version_requirements: *70265474354120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: test_declarative
27
- requirement: &70154104357400 !ruby/object:Gem::Requirement
27
+ requirement: &70265474353320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 0.0.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70154104357400
35
+ version_requirements: *70265474353320
36
36
  description: Simple Hash extension to make working with nested hashes (e.g. for configuration)
37
37
  easier and less error-prone.
38
38
  email: svenfuchs@artweb-design.de
@@ -72,9 +72,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  version: '0'
73
73
  requirements: []
74
74
  rubyforge_project: ! '[none]'
75
- rubygems_version: 1.8.6
75
+ rubygems_version: 1.8.10
76
76
  signing_key:
77
77
  specification_version: 3
78
78
  summary: Simple Hash extension to make working with nested hashes (e.g. for configuration)
79
79
  easier and less error-prone
80
80
  test_files: []
81
+ has_rdoc: