navigable_hash 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/navigable_hash.rb +1 -1
- data/navigable_hash.gemspec +1 -1
- data/spec/lib/navigable_hash_spec.rb +18 -3
- metadata +3 -3
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# NavigableHash
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/navigable_hash)
|
3
4
|
[](https://travis-ci.org/jwaldrip/navigable_hash)
|
4
5
|
[](https://coveralls.io/r/jwaldrip/navigable_hash)
|
5
6
|
[](https://codeclimate.com/github/jwaldrip/navigable_hash)
|
6
|
-
[](https://gemnasium.com/jwaldrip/navigable_hash)
|
7
7
|
|
8
8
|
NavigableHash was built as lightweight and quick way to navigate through a hash or array object using the familiar ruby dot notation. See 'Usage' below for examples. Keys as strings or symbols don't matter, its all included.
|
9
9
|
|
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.0.
|
7
|
+
spec.version = "1.0.1"
|
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.}
|
@@ -79,7 +79,7 @@ describe NavigableHash do
|
|
79
79
|
end
|
80
80
|
|
81
81
|
it "should set a value" do
|
82
|
-
expect { navigable.__any_method__ = 'value' }.to change { navigable
|
82
|
+
expect { navigable.__any_method__ = 'value' }.to change { navigable[:__any_method__] }
|
83
83
|
end
|
84
84
|
|
85
85
|
it "should raise an error with more than one argument" do
|
@@ -237,8 +237,23 @@ describe NavigableHash do
|
|
237
237
|
end
|
238
238
|
|
239
239
|
describe "#respond_to?" do
|
240
|
-
|
241
|
-
|
240
|
+
context "if the key exists" do
|
241
|
+
it "should be " do
|
242
|
+
navigable.respond_to?(:this_is_not_a_method).should be_false
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
context "if the key does not exist" do
|
247
|
+
it "should be " do
|
248
|
+
navigable[:this_is_not_a_method] = "Hello"
|
249
|
+
navigable.respond_to?(:this_is_not_a_method).should be_true
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
context "with a real method" do
|
254
|
+
it "should be true" do
|
255
|
+
navigable.respond_to?(:to_hash).should be_true
|
256
|
+
end
|
242
257
|
end
|
243
258
|
end
|
244
259
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: navigable_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-04-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
152
|
rubyforge_project:
|
153
|
-
rubygems_version: 1.8.
|
153
|
+
rubygems_version: 1.8.23
|
154
154
|
signing_key:
|
155
155
|
specification_version: 3
|
156
156
|
summary: Allows a hash to be navigated with dot notation or indifferent access.
|