rb_json5 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +9 -0
- data/lib/rb_json5/parser.rb +8 -4
- data/lib/rb_json5/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec87a5e7a2a8cd08a6f4abb5d40adf68d61d451ea1b3852f21e0095f65c803bc
|
4
|
+
data.tar.gz: cb024d57a7bbf4bc1253b6b2c8b251240d4ba35977336020564b90959c46ac37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 834f3593354bbd8879739715f429a1cc0d74a91e6fe70f44bee9e6df6a32cda4e1e8d37fc32d052b0cff519ec17741645ea341ff545fe2d88dec7b51ef3c7ae9
|
7
|
+
data.tar.gz: 20c1e4f6000343958a351942d9313be5a1fc3d5eee464bd2454c764edeba494910f48e46171aecc2c77e0bb0a4473a44bcde372525f71aee816c2061582751ef
|
data/.yardopts
ADDED
data/lib/rb_json5/parser.rb
CHANGED
@@ -55,7 +55,7 @@ module RbJSON5
|
|
55
55
|
# @see RbJSON5.parse
|
56
56
|
# @see RbJSON5.load_file
|
57
57
|
def parse(string_or_io, symbolize_names = false)
|
58
|
-
tree = parser.parse(read_json5(string_or_io))
|
58
|
+
tree = parser.parse(read_json5(string_or_io), reporter: error_reporter)
|
59
59
|
transform.apply(tree, symbolize_names: symbolize_names)
|
60
60
|
rescue Parslet::ParseFailed => e
|
61
61
|
raise ParseError.new(e.message, e.parse_failure_cause)
|
@@ -63,14 +63,18 @@ module RbJSON5
|
|
63
63
|
|
64
64
|
private
|
65
65
|
|
66
|
+
def parser
|
67
|
+
parser = self.class.parser.new
|
68
|
+
@root && parser.__send__(@root) || parser
|
69
|
+
end
|
70
|
+
|
66
71
|
def read_json5(string_or_io)
|
67
72
|
string_or_io.respond_to?(:read) &&
|
68
73
|
string_or_io.read || string_or_io
|
69
74
|
end
|
70
75
|
|
71
|
-
def
|
72
|
-
|
73
|
-
@root && parser.__send__(@root) || parser
|
76
|
+
def error_reporter
|
77
|
+
Parslet::ErrorReporter::Contextual.new
|
74
78
|
end
|
75
79
|
|
76
80
|
def transform
|
data/lib/rb_json5/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb_json5
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taichi Ishitani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|
@@ -143,6 +143,7 @@ executables: []
|
|
143
143
|
extensions: []
|
144
144
|
extra_rdoc_files: []
|
145
145
|
files:
|
146
|
+
- ".yardopts"
|
146
147
|
- CODE_OF_CONDUCT.md
|
147
148
|
- LICENSE
|
148
149
|
- README.md
|