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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81546e53f09d625b4f122a5264f654797e25994cbb2f43a6ec295e2c254ec61d
4
- data.tar.gz: acf65352e98ab217357718ede345a7574be7a8f84cf07063d5113d92346a69ed
3
+ metadata.gz: ec87a5e7a2a8cd08a6f4abb5d40adf68d61d451ea1b3852f21e0095f65c803bc
4
+ data.tar.gz: cb024d57a7bbf4bc1253b6b2c8b251240d4ba35977336020564b90959c46ac37
5
5
  SHA512:
6
- metadata.gz: 77a07e83d48962228590d106d33d294dbdc5c02cf8c9b5c08b01e8fc4dd01341a4a6cfc1c682f6ebcc78bf990b3aa404eecc6642fdde2818d1f9f82fe6ec5cf3
7
- data.tar.gz: b8d9b1425211e63127d195fb191226577203fc543545b8add0afd8a896bdbb98f928884471ba4bc52bef647ccf2fca53ffdf9e7a627f2e204f1ab7d33b98c9e5
6
+ metadata.gz: 834f3593354bbd8879739715f429a1cc0d74a91e6fe70f44bee9e6df6a32cda4e1e8d37fc32d052b0cff519ec17741645ea341ff545fe2d88dec7b51ef3c7ae9
7
+ data.tar.gz: 20c1e4f6000343958a351942d9313be5a1fc3d5eee464bd2454c764edeba494910f48e46171aecc2c77e0bb0a4473a44bcde372525f71aee816c2061582751ef
@@ -0,0 +1,9 @@
1
+ --main=README.md
2
+ --markup=markdown
3
+ --markup-provider=redcarpet
4
+
5
+ lib/**/*.rb
6
+ -
7
+ LICENSE
8
+ CODE_OF_CONDUCT.md
9
+ README.md
@@ -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 parser
72
- parser = self.class.parser.new
73
- @root && parser.__send__(@root) || parser
76
+ def error_reporter
77
+ Parslet::ErrorReporter::Contextual.new
74
78
  end
75
79
 
76
80
  def transform
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RbJSON5
4
4
  # Current version of RbJSON5
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
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.2.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-02 00:00:00.000000000 Z
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