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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d638b0073b7d93162c45b1feb8a91bcb09673a0
4
- data.tar.gz: 311e31b62ab9eba37ac97934fe7dabe7c370ef5c
3
+ metadata.gz: 13e79054a49cb41c74e7f3c80aea631b9428d9eb
4
+ data.tar.gz: a1275b379060bda2a6f8e9a8872e0dcc2755c5cd
5
5
  SHA512:
6
- metadata.gz: d6e4edb5fed25fce9fc197ba81fd77ba235fab07e5d061e74b3b142b7e1df46d4165d3b096b65f0060c0a2494e9123ce76463a999acca3edd861ee4448e82049
7
- data.tar.gz: aa6efe25b941c14e23ecf274a099ab6e6e12a15e095bf5d236c0e9ab18e9315318ae3ba887a80436152a0f66e01bf914e9f04011165148ce52a5a8028270a894
6
+ metadata.gz: 78e515046dc02914e92a601dfa2cad52538bba73dde9bba215e66ec7fa3acff2617652beaf09a63f8db160c5aedd3daeaffddc548264eafb3c5b4f2a45a2af05
7
+ data.tar.gz: 0d9d0bb8399233186eaca833a5b6d0731a69c7a08f113681258b21eb3032ee928639da6c46b262fc212c394815057d77ee1e2c48f13738ad70f950b87f75c4c0
@@ -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'
@@ -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
- each(node, e, pos + 1) { |n|
37
- @_current_node = n
38
- yield n if process_function_or_literal(sub_path[1, sub_path.size - 1])
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])
@@ -1,3 +1,3 @@
1
1
  class JsonPath
2
- VERSION = '0.5.5'
2
+ VERSION = '0.5.6'
3
3
  end
@@ -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.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: 2013-10-24 00:00:00.000000000 Z
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.0.3
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/