json_p3 0.3.0 → 0.3.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/README.md +7 -1
- data/lib/json_p3/parser.rb +3 -3
- data/lib/json_p3/patch.rb +10 -2
- data/lib/json_p3/unescape.rb +1 -1
- data/lib/json_p3/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58f9239b2c34d2ad4b9bcd724f19cd2e6daab881befb2b568d44065ab3378864
|
4
|
+
data.tar.gz: a76e4a183e830bbfab1f925efde9e9e6e4fb36b2687c13ab0c85b609b01b5baf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c36a725f0856cfa9e2c8f91931a008db812dfd17b3d4ad1afad59cddf56afac0c91ad221d258950a2a755ffa988cef8ee0f5cf43f08ca0eccbf3c3be7facdf4f
|
7
|
+
data.tar.gz: a17d419c6dbd96c15596052eaf12b0615725590b5e448d33ffc48e44082d95011ea3f119e0c2529b871c7be16ded8d5c7c1296c3479c03bc16c8e81d2ce33034
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -474,6 +474,12 @@ Print memory usage to the terminal.
|
|
474
474
|
bundle exec ruby performance/memory_profile.rb
|
475
475
|
```
|
476
476
|
|
477
|
-
###
|
477
|
+
### Notes to self
|
478
|
+
|
479
|
+
#### Build
|
480
|
+
|
481
|
+
`bundle exec rake release` and `bundle exec rake build` will look for `gem-private_key.pem` and `gem-public_cert.pem` in `~/.gem`.
|
482
|
+
|
483
|
+
#### TruffleRuby
|
478
484
|
|
479
485
|
On macOS Sonoma using MacPorts and `rbenv`, `LIBYAML_PREFIX=/opt/local/lib` is needed to install TruffleRuby and when executing any `bundle` command.
|
data/lib/json_p3/parser.rb
CHANGED
@@ -116,7 +116,7 @@ module JSONP3
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
def parse_bracketed_selection(stream)
|
119
|
+
def parse_bracketed_selection(stream)
|
120
120
|
stream.expect(:token_lbracket)
|
121
121
|
segment_token = stream.next
|
122
122
|
|
@@ -245,7 +245,7 @@ module JSONP3
|
|
245
245
|
FilterSelector.new(@env, token, FilterExpression.new(token, expression))
|
246
246
|
end
|
247
247
|
|
248
|
-
def parse_filter_expression(stream, precedence = Precedence::LOWEST) # rubocop:disable Metrics/
|
248
|
+
def parse_filter_expression(stream, precedence = Precedence::LOWEST) # rubocop:disable Metrics/CyclomaticComplexity
|
249
249
|
left = case stream.peek.type
|
250
250
|
when :token_double_quote_string, :token_single_quote_string
|
251
251
|
token = stream.next
|
@@ -313,7 +313,7 @@ module JSONP3
|
|
313
313
|
end
|
314
314
|
end
|
315
315
|
|
316
|
-
def parse_function_expression(stream)
|
316
|
+
def parse_function_expression(stream)
|
317
317
|
token = stream.next
|
318
318
|
args = [] # : Array[Expression]
|
319
319
|
|
data/lib/json_p3/patch.rb
CHANGED
@@ -220,7 +220,11 @@ module JSONP3
|
|
220
220
|
|
221
221
|
# Write the source value to the destination.
|
222
222
|
if dest_parent.is_a?(Array)
|
223
|
-
|
223
|
+
if dest_target == "-"
|
224
|
+
dest_parent << source_obj
|
225
|
+
else
|
226
|
+
dest_parent[dest_target.to_i] = source_obj
|
227
|
+
end
|
224
228
|
elsif dest_parent.is_a?(Hash)
|
225
229
|
dest_parent[dest_target] = source_obj
|
226
230
|
end
|
@@ -267,7 +271,11 @@ module JSONP3
|
|
267
271
|
|
268
272
|
# Write the source value to the destination.
|
269
273
|
if dest_parent.is_a?(Array)
|
270
|
-
|
274
|
+
if dest_target == "-"
|
275
|
+
dest_parent << source_obj
|
276
|
+
else
|
277
|
+
dest_parent.insert(dest_target.to_i, deep_copy(source_obj))
|
278
|
+
end
|
271
279
|
elsif dest_parent.is_a?(Hash)
|
272
280
|
dest_parent[dest_target] = deep_copy(source_obj)
|
273
281
|
else
|
data/lib/json_p3/unescape.rb
CHANGED
@@ -6,7 +6,7 @@ module JSONP3 # rubocop:disable Style/Documentation
|
|
6
6
|
# @param quote [String] one of '"' or "'".
|
7
7
|
# @param token [Token]
|
8
8
|
# @return [String] A new string without escape sequences.
|
9
|
-
def self.unescape_string(value, quote, token)
|
9
|
+
def self.unescape_string(value, quote, token)
|
10
10
|
unescaped = String.new(encoding: "UTF-8")
|
11
11
|
index = 0
|
12
12
|
length = value.length
|
data/lib/json_p3/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_p3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Prior
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
6dM18fnfBc3yA4KI7AO8UAmRkTscMYV6f/K4YZR6ZYCNWRpY7rkg+arhf05aoSQf
|
37
37
|
vn9bO1bzwdnG
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2024-
|
39
|
+
date: 2024-12-05 00:00:00.000000000 Z
|
40
40
|
dependencies: []
|
41
41
|
description: JSONPath following RFC 9535
|
42
42
|
email:
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
|
-
rubygems_version: 3.
|
109
|
+
rubygems_version: 3.3.27
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: 'JSONPath: Query Expressions for JSON in Ruby'
|
metadata.gz.sig
CHANGED
Binary file
|