jsonpathv2 0.0.8 → 0.0.9

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: a1b74bc5a7d7f18153ff9c750d7a105b9c56f912
4
- data.tar.gz: 0c90224c771b4c0d30219610207df15ceaf20739
3
+ metadata.gz: 9b01dba13429a0d79b7de7c7d940a7e12a84bb5f
4
+ data.tar.gz: 2dfd060566c1220b372963955e09599c3a512b6f
5
5
  SHA512:
6
- metadata.gz: 9a4f3445cf35734d3a82eeee264f07188cb7f77d63f356c9720fbca618fca7f4e1d7faad72c8bb1867111f1cdfb8d6937d31fadb8a0ff79883d6428514a7cb10
7
- data.tar.gz: 7374f0a1c4b7e483d0ab0f4a7d1190b13a3b3358dbabdb4c09627b62622a572eacee7c801d6efff74b704dfd6e13bc7988f4357b8844004169059ad68c857b5d
6
+ metadata.gz: 0c111a51ccbb81bc5f042f599a78da5258ad2a01dbaa1159c9fc10417b366d87a68a56137caefaf88b29fa355661b80c706c670306bba3cda2ea68d3dd5e823e
7
+ data.tar.gz: 7527c3c63441d05b853dcacc9b17e7eb7e5750034bdb111bf135d3fb4f89995edefc45dbea7e68d3b8d32d250c8a363ccc9211cd4c89732878e6e8f0f835d52f
@@ -18,7 +18,7 @@ class JsonPath
18
18
  until scanner.eos?
19
19
  if token = scanner.scan(/\$|@\B|\*|\.\./)
20
20
  @path << token
21
- elsif token = scanner.scan(/[\$@a-zA-Z0-9_-]+/)
21
+ elsif token = scanner.scan(/[\$@a-zA-Z0-9:_-]+/)
22
22
  @path << "['#{token}']"
23
23
  elsif token = scanner.scan(/'(.*?)'/)
24
24
  @path << "[#{token}]"
@@ -1,3 +1,3 @@
1
1
  class JsonPath
2
- VERSION = '0.0.8'.freeze
2
+ VERSION = '0.0.9'.freeze
3
3
  end
@@ -78,6 +78,10 @@ class TestJsonpath < MiniTest::Unit::TestCase
78
78
  assert_equal [@object['store']['bicycle']['single-speed']], JsonPath.new('$.store.bicycle.single-speed').on(@object)
79
79
  end
80
80
 
81
+ def test_path_with_colon
82
+ assert_equal [@object['store']['bicycle']['make:model']], JsonPath.new('$.store.bicycle.make:model').on(@object)
83
+ end
84
+
81
85
  def test_paths_with_numbers
82
86
  assert_equal [@object['store']['bicycle']['2seater']], JsonPath.new('$.store.bicycle.2seater').on(@object)
83
87
  end
@@ -91,7 +95,7 @@ class TestJsonpath < MiniTest::Unit::TestCase
91
95
  end
92
96
 
93
97
  def test_counting
94
- assert_equal 49, JsonPath.new('$..*').on(@object).to_a.size
98
+ assert_equal 50, JsonPath.new('$..*').on(@object).to_a.size
95
99
  end
96
100
 
97
101
  def test_space_in_path
@@ -256,7 +260,8 @@ class TestJsonpath < MiniTest::Unit::TestCase
256
260
  'price' => 20,
257
261
  'catalogue_number' => 123_45,
258
262
  'single-speed' => 'no',
259
- '2seater' => 'yes'
263
+ '2seater' => 'yes',
264
+ 'make:model' => 'Zippy Sweetwheeler'
260
265
  }
261
266
  } }
262
267
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonpathv2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gergely Brautigam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-10 00:00:00.000000000 Z
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project: jsonpathv2
142
- rubygems_version: 2.6.6
142
+ rubygems_version: 2.6.10
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Ruby implementation of http://goessner.net/articles/JsonPath/