navigable_hash 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.travis.yml +0 -2
- data/Guardfile +13 -0
- data/lib/navigable_hash.rb +1 -1
- data/navigable_hash.gemspec +9 -6
- data/spec/helpers/helper_methods.rb +3 -3
- data/spec/lib/navigable_hash_spec.rb +16 -2
- metadata +68 -39
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTM0ODE0MTZmMTBjZWIyNGI1ZjI0ZTBiMjhjNGEwOWZkZjA0YWJmYQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YmMwNzU2NDQ2M2I3MWNiM2JkNjg0ODk5YmUzNzM2Njk1OWY4Yzg3NQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjQ0MGEwNTdmZTE2ZTU5YjMwODAyZmI0M2RmMzE2OThhMmI4ZjIwNWIzMjli
|
10
|
+
ZGM1N2E1MWJlNTJlODhhNjU5NDJmZWMzMGMzOWUyMzA4MTNjNjhiNmY0NDZl
|
11
|
+
YzcyN2EzN2M3ODEwNDk5MGIwNjc1YWFhYzBmZThkZDc1M2JhM2Y=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MmZkNjk4ODU1MzNlNTNkNzg5MjZlMDc5ZmRiMDgxYjI5NDEyMTAzMWNiN2Vm
|
14
|
+
ZWMwMzEwODY3ZjU4Nzk3MjgwMDllNGY0NzZmZWYxOGEzMzVlMGM0MzU5MjUz
|
15
|
+
ODg4ZTZkNjYyNDU1NDI0NzkyNGRiNDM4YzhiNzJjYjg5NTRlNmU=
|
data/.travis.yml
CHANGED
data/Guardfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'bundler' do
|
5
|
+
watch('Gemfile')
|
6
|
+
watch(/^.+\.gemspec/)
|
7
|
+
end
|
8
|
+
|
9
|
+
guard :rspec do
|
10
|
+
watch(%r{^spec/.+_spec\.rb$})
|
11
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
12
|
+
watch('spec/spec_helper.rb') { "spec" }
|
13
|
+
end
|
data/lib/navigable_hash.rb
CHANGED
data/navigable_hash.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "navigable_hash"
|
7
|
-
spec.version = "1.
|
7
|
+
spec.version = "1.2.0"
|
8
8
|
spec.authors = ["Jason Waldrip", "Kevin Wanek"]
|
9
9
|
spec.email = ["jason@waldrip.net", "k@dmcy.us"]
|
10
10
|
spec.description = %q{Allows a hash to be navigated with dot notation or indifferent access.}
|
@@ -18,10 +18,13 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_development_dependency "bundler", "~> 1.3"
|
21
|
-
spec.add_development_dependency "rake"
|
22
|
-
spec.add_development_dependency "rspec"
|
23
|
-
spec.add_development_dependency "pry"
|
24
|
-
spec.add_development_dependency "coveralls"
|
25
|
-
spec.add_development_dependency "
|
21
|
+
spec.add_development_dependency "rake", "10.1.0"
|
22
|
+
spec.add_development_dependency "rspec", '2.14'
|
23
|
+
spec.add_development_dependency "pry", '0.9.12.2'
|
24
|
+
spec.add_development_dependency "coveralls", "0.6.7"
|
25
|
+
spec.add_development_dependency "guard", "1.8.2"
|
26
|
+
spec.add_development_dependency "guard-rspec", "3.0.2"
|
27
|
+
spec.add_development_dependency "guard-bundler", "1.0.0"
|
28
|
+
spec.add_development_dependency "simplecov-multi", "0.0.1"
|
26
29
|
|
27
30
|
end
|
@@ -7,7 +7,7 @@ module NavigableHash::HelperMethods
|
|
7
7
|
end
|
8
8
|
describe "##{key}" do
|
9
9
|
it "should call navigate" do
|
10
|
-
navigable.
|
10
|
+
navigable.stub(:navigate)
|
11
11
|
navigable.send(key)
|
12
12
|
end
|
13
13
|
|
@@ -24,7 +24,7 @@ module NavigableHash::HelperMethods
|
|
24
24
|
end
|
25
25
|
describe "##{key}" do
|
26
26
|
it "should call navigate" do
|
27
|
-
navigable.
|
27
|
+
navigable.stub(:navigate)
|
28
28
|
navigable[key.to_sym]
|
29
29
|
end
|
30
30
|
|
@@ -41,7 +41,7 @@ module NavigableHash::HelperMethods
|
|
41
41
|
end
|
42
42
|
describe "##{key}" do
|
43
43
|
it "should call navigate" do
|
44
|
-
navigable.
|
44
|
+
navigable.stub(:navigate)
|
45
45
|
navigable[key.to_s]
|
46
46
|
end
|
47
47
|
|
@@ -68,7 +68,7 @@ describe NavigableHash do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
let(:hash){ TEST_HASH }
|
71
|
-
|
71
|
+
subject(:navigable){ NavigableHash.new(hash) }
|
72
72
|
|
73
73
|
context "with a deep setter" do
|
74
74
|
let(:hash){ {} }
|
@@ -170,8 +170,22 @@ describe NavigableHash do
|
|
170
170
|
context "given a hash" do
|
171
171
|
it "should return a new instance of navigable hash" do
|
172
172
|
hash = {:a => 1, :b => 2, :c => 3}
|
173
|
-
navigable.should_receive(:navigate_hash).with(hash)
|
173
|
+
navigable.should_receive(:navigate_hash).with(hash).and_call_original
|
174
174
|
navigable[:hash] = hash
|
175
|
+
navigable[:hash].should be_an_instance_of NavigableHash
|
176
|
+
end
|
177
|
+
|
178
|
+
context "given a subclass, setting with a navigable hash" do
|
179
|
+
before(:each) do
|
180
|
+
stub_const 'SubNavigableHash', Class.new(NavigableHash)
|
181
|
+
end
|
182
|
+
subject(:navigable){ SubNavigableHash.new(hash) }
|
183
|
+
it 'should return an instance of the subclass' do
|
184
|
+
hash = NavigableHash.new :a => 1, :b => 2, :c => 3
|
185
|
+
navigable.should_receive(:navigate_hash).with(hash).and_call_original
|
186
|
+
navigable[:hash] = hash
|
187
|
+
navigable[:hash].should be_an_instance_of SubNavigableHash
|
188
|
+
end
|
175
189
|
end
|
176
190
|
end
|
177
191
|
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: navigable_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jason Waldrip
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2013-
|
12
|
+
date: 2013-08-16 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: bundler
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,7 +21,6 @@ dependencies:
|
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
@@ -31,83 +28,115 @@ dependencies:
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rake
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '='
|
37
33
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
34
|
+
version: 10.1.0
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '='
|
45
40
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
41
|
+
version: 10.1.0
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: rspec
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- -
|
46
|
+
- - '='
|
53
47
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
48
|
+
version: '2.14'
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- -
|
53
|
+
- - '='
|
61
54
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
55
|
+
version: '2.14'
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: pry
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
|
-
- -
|
60
|
+
- - '='
|
69
61
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
62
|
+
version: 0.9.12.2
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
|
-
- -
|
67
|
+
- - '='
|
77
68
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
69
|
+
version: 0.9.12.2
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
71
|
name: coveralls
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
|
-
- -
|
74
|
+
- - '='
|
85
75
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
76
|
+
version: 0.6.7
|
87
77
|
type: :development
|
88
78
|
prerelease: false
|
89
79
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
80
|
requirements:
|
92
|
-
- -
|
81
|
+
- - '='
|
93
82
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
83
|
+
version: 0.6.7
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: guard
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - '='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 1.8.2
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 1.8.2
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: guard-rspec
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - '='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 3.0.2
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 3.0.2
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: guard-bundler
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 1.0.0
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.0.0
|
95
126
|
- !ruby/object:Gem::Dependency
|
96
127
|
name: simplecov-multi
|
97
128
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
129
|
requirements:
|
100
|
-
- -
|
130
|
+
- - '='
|
101
131
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
132
|
+
version: 0.0.1
|
103
133
|
type: :development
|
104
134
|
prerelease: false
|
105
135
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
136
|
requirements:
|
108
|
-
- -
|
137
|
+
- - '='
|
109
138
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
139
|
+
version: 0.0.1
|
111
140
|
description: Allows a hash to be navigated with dot notation or indifferent access.
|
112
141
|
email:
|
113
142
|
- jason@waldrip.net
|
@@ -121,6 +150,7 @@ files:
|
|
121
150
|
- .rspec
|
122
151
|
- .travis.yml
|
123
152
|
- Gemfile
|
153
|
+
- Guardfile
|
124
154
|
- LICENSE.txt
|
125
155
|
- README.md
|
126
156
|
- Rakefile
|
@@ -132,27 +162,26 @@ files:
|
|
132
162
|
homepage: http://github.com/jwaldrip/navigable_hash
|
133
163
|
licenses:
|
134
164
|
- MIT
|
165
|
+
metadata: {}
|
135
166
|
post_install_message:
|
136
167
|
rdoc_options: []
|
137
168
|
require_paths:
|
138
169
|
- lib
|
139
170
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
171
|
requirements:
|
142
172
|
- - ! '>='
|
143
173
|
- !ruby/object:Gem::Version
|
144
174
|
version: '0'
|
145
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
176
|
requirements:
|
148
177
|
- - ! '>='
|
149
178
|
- !ruby/object:Gem::Version
|
150
179
|
version: '0'
|
151
180
|
requirements: []
|
152
181
|
rubyforge_project:
|
153
|
-
rubygems_version:
|
182
|
+
rubygems_version: 2.0.6
|
154
183
|
signing_key:
|
155
|
-
specification_version:
|
184
|
+
specification_version: 4
|
156
185
|
summary: Allows a hash to be navigated with dot notation or indifferent access.
|
157
186
|
test_files:
|
158
187
|
- spec/helpers/helper_methods.rb
|