jsonpath 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jsonpath.gemspec +1 -0
- data/lib/jsonpath/enumerable.rb +4 -4
- data/lib/jsonpath/version.rb +1 -1
- data/test/test_jsonpath.rb +4 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13e79054a49cb41c74e7f3c80aea631b9428d9eb
|
4
|
+
data.tar.gz: a1275b379060bda2a6f8e9a8872e0dcc2755c5cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78e515046dc02914e92a601dfa2cad52538bba73dde9bba215e66ec7fa3acff2617652beaf09a63f8db160c5aedd3daeaffddc548264eafb3c5b4f2a45a2af05
|
7
|
+
data.tar.gz: 0d9d0bb8399233186eaca833a5b6d0731a69c7a08f113681258b21eb3032ee928639da6c46b262fc212c394815057d77ee1e2c48f13738ad70f950b87f75c4c0
|
data/jsonpath.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.test_files = `git ls-files`.split("\n").select{|f| f =~ /^spec/}
|
20
20
|
s.rubyforge_project = 'jsonpath'
|
21
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
+
s.licenses = ['MIT']
|
22
23
|
|
23
24
|
# dependencies
|
24
25
|
s.add_runtime_dependency 'multi_json'
|
data/lib/jsonpath/enumerable.rb
CHANGED
@@ -33,10 +33,10 @@ class JsonPath
|
|
33
33
|
case node
|
34
34
|
when Hash, Array
|
35
35
|
(node.is_a?(Hash) ? node.keys : (0..node.size)).each do |e|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
@_current_node = node[e]
|
37
|
+
if process_function_or_literal(sub_path[1, sub_path.size - 1])
|
38
|
+
each(@_current_node, nil, pos + 1, &blk)
|
39
|
+
end
|
40
40
|
end
|
41
41
|
else
|
42
42
|
yield node if process_function_or_literal(sub_path[1, sub_path.size - 1])
|
data/lib/jsonpath/version.rb
CHANGED
data/test/test_jsonpath.rb
CHANGED
@@ -148,6 +148,10 @@ class TestJsonpath < MiniTest::Unit::TestCase
|
|
148
148
|
assert_equal [@object['store']['book'][3]], JsonPath.new("$..book[?(@.price > 20)]").on(@object)
|
149
149
|
end
|
150
150
|
|
151
|
+
def test_support_filter_by_childnode_value_and_select_child_key
|
152
|
+
assert_equal [23], JsonPath.new("$..book[?(@.price > 20)].price").on(@object)
|
153
|
+
end
|
154
|
+
|
151
155
|
def example_object
|
152
156
|
{ "store"=> {
|
153
157
|
"book" => [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonpath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Hull
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -118,7 +118,8 @@ files:
|
|
118
118
|
- test/test_jsonpath.rb
|
119
119
|
- test/test_jsonpath_bin.rb
|
120
120
|
homepage: http://github.com/joshbuddy/jsonpath
|
121
|
-
licenses:
|
121
|
+
licenses:
|
122
|
+
- MIT
|
122
123
|
metadata: {}
|
123
124
|
post_install_message:
|
124
125
|
rdoc_options:
|
@@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
138
|
version: '0'
|
138
139
|
requirements: []
|
139
140
|
rubyforge_project: jsonpath
|
140
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.1.11
|
141
142
|
signing_key:
|
142
143
|
specification_version: 4
|
143
144
|
summary: Ruby implementation of http://goessner.net/articles/JsonPath/
|