json 2.0.3 → 2.5.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 +5 -5
- data/CHANGES.md +66 -0
- data/Gemfile +1 -3
- data/LICENSE +56 -0
- data/README.md +54 -21
- data/VERSION +1 -1
- data/ext/json/ext/fbuffer/fbuffer.h +0 -3
- data/ext/json/ext/generator/generator.c +229 -54
- data/ext/json/ext/generator/generator.h +5 -3
- data/ext/json/ext/parser/extconf.rb +25 -0
- data/ext/json/ext/parser/parser.c +180 -85
- data/ext/json/ext/parser/parser.h +2 -0
- data/ext/json/ext/parser/parser.rl +104 -9
- data/ext/json/extconf.rb +1 -0
- data/json.gemspec +0 -0
- data/lib/json/add/bigdecimal.rb +2 -2
- data/lib/json/add/complex.rb +2 -3
- data/lib/json/add/ostruct.rb +1 -1
- data/lib/json/add/rational.rb +2 -3
- data/lib/json/add/regexp.rb +2 -2
- data/lib/json/add/set.rb +29 -0
- data/lib/json/common.rb +372 -125
- data/lib/json/pure/generator.rb +31 -10
- data/lib/json/pure/parser.rb +35 -5
- data/lib/json/version.rb +1 -1
- data/lib/json.rb +549 -29
- data/tests/fixtures/fail29.json +1 -0
- data/tests/fixtures/fail30.json +1 -0
- data/tests/fixtures/fail31.json +1 -0
- data/tests/fixtures/fail32.json +1 -0
- data/tests/json_addition_test.rb +6 -0
- data/tests/json_common_interface_test.rb +47 -4
- data/tests/json_encoding_test.rb +2 -0
- data/tests/json_fixtures_test.rb +9 -1
- data/tests/json_generator_test.rb +30 -8
- data/tests/json_parser_test.rb +43 -12
- data/tests/lib/core_assertions.rb +763 -0
- data/tests/lib/envutil.rb +365 -0
- data/tests/lib/find_executable.rb +22 -0
- data/tests/lib/helper.rb +4 -0
- data/tests/ractor_test.rb +30 -0
- data/tests/test_helper.rb +3 -7
- metadata +31 -44
- data/.gitignore +0 -17
- data/.travis.yml +0 -19
- data/README-json-jruby.md +0 -33
- data/Rakefile +0 -408
- data/data/example.json +0 -1
- data/data/index.html +0 -38
- data/data/prototype.js +0 -4184
- data/diagrams/.keep +0 -0
- data/install.rb +0 -23
- data/java/src/json/ext/ByteListTranscoder.java +0 -166
- data/java/src/json/ext/Generator.java +0 -443
- data/java/src/json/ext/GeneratorMethods.java +0 -231
- data/java/src/json/ext/GeneratorService.java +0 -42
- data/java/src/json/ext/GeneratorState.java +0 -490
- data/java/src/json/ext/OptionsReader.java +0 -113
- data/java/src/json/ext/Parser.java +0 -2347
- data/java/src/json/ext/Parser.rl +0 -878
- data/java/src/json/ext/ParserService.java +0 -34
- data/java/src/json/ext/RuntimeInfo.java +0 -116
- data/java/src/json/ext/StringDecoder.java +0 -166
- data/java/src/json/ext/StringEncoder.java +0 -111
- data/java/src/json/ext/Utils.java +0 -88
- data/json-java.gemspec +0 -38
- data/json_pure.gemspec +0 -38
- data/references/rfc7159.txt +0 -899
- data/tools/diff.sh +0 -18
- data/tools/fuzz.rb +0 -131
- data/tools/server.rb +0 -62
@@ -0,0 +1,365 @@
|
|
1
|
+
# -*- coding: us-ascii -*-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require "open3"
|
4
|
+
require "timeout"
|
5
|
+
require_relative "find_executable"
|
6
|
+
begin
|
7
|
+
require 'rbconfig'
|
8
|
+
rescue LoadError
|
9
|
+
end
|
10
|
+
begin
|
11
|
+
require "rbconfig/sizeof"
|
12
|
+
rescue LoadError
|
13
|
+
end
|
14
|
+
|
15
|
+
module EnvUtil
|
16
|
+
def rubybin
|
17
|
+
if ruby = ENV["RUBY"]
|
18
|
+
return ruby
|
19
|
+
end
|
20
|
+
ruby = "ruby"
|
21
|
+
exeext = RbConfig::CONFIG["EXEEXT"]
|
22
|
+
rubyexe = (ruby + exeext if exeext and !exeext.empty?)
|
23
|
+
3.times do
|
24
|
+
if File.exist? ruby and File.executable? ruby and !File.directory? ruby
|
25
|
+
return File.expand_path(ruby)
|
26
|
+
end
|
27
|
+
if rubyexe and File.exist? rubyexe and File.executable? rubyexe
|
28
|
+
return File.expand_path(rubyexe)
|
29
|
+
end
|
30
|
+
ruby = File.join("..", ruby)
|
31
|
+
end
|
32
|
+
if defined?(RbConfig.ruby)
|
33
|
+
RbConfig.ruby
|
34
|
+
else
|
35
|
+
"ruby"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
module_function :rubybin
|
39
|
+
|
40
|
+
LANG_ENVS = %w"LANG LC_ALL LC_CTYPE"
|
41
|
+
|
42
|
+
DEFAULT_SIGNALS = Signal.list
|
43
|
+
DEFAULT_SIGNALS.delete("TERM") if /mswin|mingw/ =~ RUBY_PLATFORM
|
44
|
+
|
45
|
+
RUBYLIB = ENV["RUBYLIB"]
|
46
|
+
|
47
|
+
class << self
|
48
|
+
attr_accessor :timeout_scale
|
49
|
+
attr_reader :original_internal_encoding, :original_external_encoding,
|
50
|
+
:original_verbose, :original_warning
|
51
|
+
|
52
|
+
def capture_global_values
|
53
|
+
@original_internal_encoding = Encoding.default_internal
|
54
|
+
@original_external_encoding = Encoding.default_external
|
55
|
+
@original_verbose = $VERBOSE
|
56
|
+
@original_warning = %i[deprecated experimental].to_h {|i| [i, Warning[i]]} if RUBY_VERSION > "2.7"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def apply_timeout_scale(t)
|
61
|
+
if scale = EnvUtil.timeout_scale
|
62
|
+
t * scale
|
63
|
+
else
|
64
|
+
t
|
65
|
+
end
|
66
|
+
end
|
67
|
+
module_function :apply_timeout_scale
|
68
|
+
|
69
|
+
def timeout(sec, klass = nil, message = nil, &blk)
|
70
|
+
return yield(sec) if sec == nil or sec.zero?
|
71
|
+
sec = apply_timeout_scale(sec)
|
72
|
+
Timeout.timeout(sec, klass, message, &blk)
|
73
|
+
end
|
74
|
+
module_function :timeout
|
75
|
+
|
76
|
+
def terminate(pid, signal = :TERM, pgroup = nil, reprieve = 1)
|
77
|
+
reprieve = apply_timeout_scale(reprieve) if reprieve
|
78
|
+
|
79
|
+
signals = Array(signal).select do |sig|
|
80
|
+
DEFAULT_SIGNALS[sig.to_s] or
|
81
|
+
DEFAULT_SIGNALS[Signal.signame(sig)] rescue false
|
82
|
+
end
|
83
|
+
signals |= [:ABRT, :KILL]
|
84
|
+
case pgroup
|
85
|
+
when 0, true
|
86
|
+
pgroup = -pid
|
87
|
+
when nil, false
|
88
|
+
pgroup = pid
|
89
|
+
end
|
90
|
+
|
91
|
+
lldb = true if /darwin/ =~ RUBY_PLATFORM
|
92
|
+
|
93
|
+
while signal = signals.shift
|
94
|
+
|
95
|
+
if lldb and [:ABRT, :KILL].include?(signal)
|
96
|
+
lldb = false
|
97
|
+
# sudo -n: --non-interactive
|
98
|
+
# lldb -p: attach
|
99
|
+
# -o: run command
|
100
|
+
system(*%W[sudo -n lldb -p #{pid} --batch -o bt\ all -o call\ rb_vmdebug_stack_dump_all_threads() -o quit])
|
101
|
+
true
|
102
|
+
end
|
103
|
+
|
104
|
+
begin
|
105
|
+
Process.kill signal, pgroup
|
106
|
+
rescue Errno::EINVAL
|
107
|
+
next
|
108
|
+
rescue Errno::ESRCH
|
109
|
+
break
|
110
|
+
end
|
111
|
+
if signals.empty? or !reprieve
|
112
|
+
Process.wait(pid)
|
113
|
+
else
|
114
|
+
begin
|
115
|
+
Timeout.timeout(reprieve) {Process.wait(pid)}
|
116
|
+
rescue Timeout::Error
|
117
|
+
else
|
118
|
+
break
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
$?
|
123
|
+
end
|
124
|
+
module_function :terminate
|
125
|
+
|
126
|
+
def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = false,
|
127
|
+
encoding: nil, timeout: 10, reprieve: 1, timeout_error: Timeout::Error,
|
128
|
+
stdout_filter: nil, stderr_filter: nil,
|
129
|
+
signal: :TERM,
|
130
|
+
rubybin: EnvUtil.rubybin, precommand: nil,
|
131
|
+
**opt)
|
132
|
+
timeout = apply_timeout_scale(timeout)
|
133
|
+
|
134
|
+
in_c, in_p = IO.pipe
|
135
|
+
out_p, out_c = IO.pipe if capture_stdout
|
136
|
+
err_p, err_c = IO.pipe if capture_stderr && capture_stderr != :merge_to_stdout
|
137
|
+
opt[:in] = in_c
|
138
|
+
opt[:out] = out_c if capture_stdout
|
139
|
+
opt[:err] = capture_stderr == :merge_to_stdout ? out_c : err_c if capture_stderr
|
140
|
+
if encoding
|
141
|
+
out_p.set_encoding(encoding) if out_p
|
142
|
+
err_p.set_encoding(encoding) if err_p
|
143
|
+
end
|
144
|
+
c = "C"
|
145
|
+
child_env = {}
|
146
|
+
LANG_ENVS.each {|lc| child_env[lc] = c}
|
147
|
+
if Array === args and Hash === args.first
|
148
|
+
child_env.update(args.shift)
|
149
|
+
end
|
150
|
+
if RUBYLIB and lib = child_env["RUBYLIB"]
|
151
|
+
child_env["RUBYLIB"] = [lib, RUBYLIB].join(File::PATH_SEPARATOR)
|
152
|
+
end
|
153
|
+
child_env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
|
154
|
+
args = [args] if args.kind_of?(String)
|
155
|
+
pid = spawn(child_env, *precommand, rubybin, *args, **opt)
|
156
|
+
in_c.close
|
157
|
+
out_c&.close
|
158
|
+
out_c = nil
|
159
|
+
err_c&.close
|
160
|
+
err_c = nil
|
161
|
+
if block_given?
|
162
|
+
return yield in_p, out_p, err_p, pid
|
163
|
+
else
|
164
|
+
th_stdout = Thread.new { out_p.read } if capture_stdout
|
165
|
+
th_stderr = Thread.new { err_p.read } if capture_stderr && capture_stderr != :merge_to_stdout
|
166
|
+
in_p.write stdin_data.to_str unless stdin_data.empty?
|
167
|
+
in_p.close
|
168
|
+
if (!th_stdout || th_stdout.join(timeout)) && (!th_stderr || th_stderr.join(timeout))
|
169
|
+
timeout_error = nil
|
170
|
+
else
|
171
|
+
status = terminate(pid, signal, opt[:pgroup], reprieve)
|
172
|
+
terminated = Time.now
|
173
|
+
end
|
174
|
+
stdout = th_stdout.value if capture_stdout
|
175
|
+
stderr = th_stderr.value if capture_stderr && capture_stderr != :merge_to_stdout
|
176
|
+
out_p.close if capture_stdout
|
177
|
+
err_p.close if capture_stderr && capture_stderr != :merge_to_stdout
|
178
|
+
status ||= Process.wait2(pid)[1]
|
179
|
+
stdout = stdout_filter.call(stdout) if stdout_filter
|
180
|
+
stderr = stderr_filter.call(stderr) if stderr_filter
|
181
|
+
if timeout_error
|
182
|
+
bt = caller_locations
|
183
|
+
msg = "execution of #{bt.shift.label} expired timeout (#{timeout} sec)"
|
184
|
+
msg = failure_description(status, terminated, msg, [stdout, stderr].join("\n"))
|
185
|
+
raise timeout_error, msg, bt.map(&:to_s)
|
186
|
+
end
|
187
|
+
return stdout, stderr, status
|
188
|
+
end
|
189
|
+
ensure
|
190
|
+
[th_stdout, th_stderr].each do |th|
|
191
|
+
th.kill if th
|
192
|
+
end
|
193
|
+
[in_c, in_p, out_c, out_p, err_c, err_p].each do |io|
|
194
|
+
io&.close
|
195
|
+
end
|
196
|
+
[th_stdout, th_stderr].each do |th|
|
197
|
+
th.join if th
|
198
|
+
end
|
199
|
+
end
|
200
|
+
module_function :invoke_ruby
|
201
|
+
|
202
|
+
def verbose_warning
|
203
|
+
class << (stderr = "".dup)
|
204
|
+
alias write concat
|
205
|
+
def flush; end
|
206
|
+
end
|
207
|
+
stderr, $stderr = $stderr, stderr
|
208
|
+
$VERBOSE = true
|
209
|
+
yield stderr
|
210
|
+
return $stderr
|
211
|
+
ensure
|
212
|
+
stderr, $stderr = $stderr, stderr
|
213
|
+
$VERBOSE = EnvUtil.original_verbose
|
214
|
+
EnvUtil.original_warning.each {|i, v| Warning[i] = v}
|
215
|
+
end
|
216
|
+
module_function :verbose_warning
|
217
|
+
|
218
|
+
def default_warning
|
219
|
+
$VERBOSE = false
|
220
|
+
yield
|
221
|
+
ensure
|
222
|
+
$VERBOSE = EnvUtil.original_verbose
|
223
|
+
end
|
224
|
+
module_function :default_warning
|
225
|
+
|
226
|
+
def suppress_warning
|
227
|
+
$VERBOSE = nil
|
228
|
+
yield
|
229
|
+
ensure
|
230
|
+
$VERBOSE = EnvUtil.original_verbose
|
231
|
+
end
|
232
|
+
module_function :suppress_warning
|
233
|
+
|
234
|
+
def under_gc_stress(stress = true)
|
235
|
+
stress, GC.stress = GC.stress, stress
|
236
|
+
yield
|
237
|
+
ensure
|
238
|
+
GC.stress = stress
|
239
|
+
end
|
240
|
+
module_function :under_gc_stress
|
241
|
+
|
242
|
+
def with_default_external(enc)
|
243
|
+
suppress_warning { Encoding.default_external = enc }
|
244
|
+
yield
|
245
|
+
ensure
|
246
|
+
suppress_warning { Encoding.default_external = EnvUtil.original_external_encoding }
|
247
|
+
end
|
248
|
+
module_function :with_default_external
|
249
|
+
|
250
|
+
def with_default_internal(enc)
|
251
|
+
suppress_warning { Encoding.default_internal = enc }
|
252
|
+
yield
|
253
|
+
ensure
|
254
|
+
suppress_warning { Encoding.default_internal = EnvUtil.original_internal_encoding }
|
255
|
+
end
|
256
|
+
module_function :with_default_internal
|
257
|
+
|
258
|
+
def labeled_module(name, &block)
|
259
|
+
Module.new do
|
260
|
+
singleton_class.class_eval {
|
261
|
+
define_method(:to_s) {name}
|
262
|
+
alias inspect to_s
|
263
|
+
alias name to_s
|
264
|
+
}
|
265
|
+
class_eval(&block) if block
|
266
|
+
end
|
267
|
+
end
|
268
|
+
module_function :labeled_module
|
269
|
+
|
270
|
+
def labeled_class(name, superclass = Object, &block)
|
271
|
+
Class.new(superclass) do
|
272
|
+
singleton_class.class_eval {
|
273
|
+
define_method(:to_s) {name}
|
274
|
+
alias inspect to_s
|
275
|
+
alias name to_s
|
276
|
+
}
|
277
|
+
class_eval(&block) if block
|
278
|
+
end
|
279
|
+
end
|
280
|
+
module_function :labeled_class
|
281
|
+
|
282
|
+
if /darwin/ =~ RUBY_PLATFORM
|
283
|
+
DIAGNOSTIC_REPORTS_PATH = File.expand_path("~/Library/Logs/DiagnosticReports")
|
284
|
+
DIAGNOSTIC_REPORTS_TIMEFORMAT = '%Y-%m-%d-%H%M%S'
|
285
|
+
@ruby_install_name = RbConfig::CONFIG['RUBY_INSTALL_NAME']
|
286
|
+
|
287
|
+
def self.diagnostic_reports(signame, pid, now)
|
288
|
+
return unless %w[ABRT QUIT SEGV ILL TRAP].include?(signame)
|
289
|
+
cmd = File.basename(rubybin)
|
290
|
+
cmd = @ruby_install_name if "ruby-runner#{RbConfig::CONFIG["EXEEXT"]}" == cmd
|
291
|
+
path = DIAGNOSTIC_REPORTS_PATH
|
292
|
+
timeformat = DIAGNOSTIC_REPORTS_TIMEFORMAT
|
293
|
+
pat = "#{path}/#{cmd}_#{now.strftime(timeformat)}[-_]*.crash"
|
294
|
+
first = true
|
295
|
+
30.times do
|
296
|
+
first ? (first = false) : sleep(0.1)
|
297
|
+
Dir.glob(pat) do |name|
|
298
|
+
log = File.read(name) rescue next
|
299
|
+
if /\AProcess:\s+#{cmd} \[#{pid}\]$/ =~ log
|
300
|
+
File.unlink(name)
|
301
|
+
File.unlink("#{path}/.#{File.basename(name)}.plist") rescue nil
|
302
|
+
return log
|
303
|
+
end
|
304
|
+
end
|
305
|
+
end
|
306
|
+
nil
|
307
|
+
end
|
308
|
+
else
|
309
|
+
def self.diagnostic_reports(signame, pid, now)
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
def self.failure_description(status, now, message = "", out = "")
|
314
|
+
pid = status.pid
|
315
|
+
if signo = status.termsig
|
316
|
+
signame = Signal.signame(signo)
|
317
|
+
sigdesc = "signal #{signo}"
|
318
|
+
end
|
319
|
+
log = diagnostic_reports(signame, pid, now)
|
320
|
+
if signame
|
321
|
+
sigdesc = "SIG#{signame} (#{sigdesc})"
|
322
|
+
end
|
323
|
+
if status.coredump?
|
324
|
+
sigdesc = "#{sigdesc} (core dumped)"
|
325
|
+
end
|
326
|
+
full_message = ''.dup
|
327
|
+
message = message.call if Proc === message
|
328
|
+
if message and !message.empty?
|
329
|
+
full_message << message << "\n"
|
330
|
+
end
|
331
|
+
full_message << "pid #{pid}"
|
332
|
+
full_message << " exit #{status.exitstatus}" if status.exited?
|
333
|
+
full_message << " killed by #{sigdesc}" if sigdesc
|
334
|
+
if out and !out.empty?
|
335
|
+
full_message << "\n" << out.b.gsub(/^/, '| ')
|
336
|
+
full_message.sub!(/(?<!\n)\z/, "\n")
|
337
|
+
end
|
338
|
+
if log
|
339
|
+
full_message << "Diagnostic reports:\n" << log.b.gsub(/^/, '| ')
|
340
|
+
end
|
341
|
+
full_message
|
342
|
+
end
|
343
|
+
|
344
|
+
def self.gc_stress_to_class?
|
345
|
+
unless defined?(@gc_stress_to_class)
|
346
|
+
_, _, status = invoke_ruby(["-e""exit GC.respond_to?(:add_stress_to_class)"])
|
347
|
+
@gc_stress_to_class = status.success?
|
348
|
+
end
|
349
|
+
@gc_stress_to_class
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
if defined?(RbConfig)
|
354
|
+
module RbConfig
|
355
|
+
@ruby = EnvUtil.rubybin
|
356
|
+
class << self
|
357
|
+
undef ruby if method_defined?(:ruby)
|
358
|
+
attr_reader :ruby
|
359
|
+
end
|
360
|
+
dir = File.dirname(ruby)
|
361
|
+
CONFIG['bindir'] = dir
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
EnvUtil.capture_global_values
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "rbconfig"
|
3
|
+
|
4
|
+
module EnvUtil
|
5
|
+
def find_executable(cmd, *args)
|
6
|
+
exts = RbConfig::CONFIG["EXECUTABLE_EXTS"].split | [RbConfig::CONFIG["EXEEXT"]]
|
7
|
+
ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
|
8
|
+
next if path.empty?
|
9
|
+
path = File.join(path, cmd)
|
10
|
+
exts.each do |ext|
|
11
|
+
cmdline = [path + ext, *args]
|
12
|
+
begin
|
13
|
+
return cmdline if yield(IO.popen(cmdline, "r", err: [:child, :out], &:read))
|
14
|
+
rescue
|
15
|
+
next
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
module_function :find_executable
|
22
|
+
end
|
data/tests/lib/helper.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# frozen_string_literal: false
|
3
|
+
|
4
|
+
require 'test_helper'
|
5
|
+
|
6
|
+
class JSONInRactorTest < Test::Unit::TestCase
|
7
|
+
def test_generate
|
8
|
+
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
|
9
|
+
begin;
|
10
|
+
$VERBOSE = nil
|
11
|
+
require "json"
|
12
|
+
r = Ractor.new do
|
13
|
+
json = JSON.generate({
|
14
|
+
'a' => 2,
|
15
|
+
'b' => 3.141,
|
16
|
+
'c' => 'c',
|
17
|
+
'd' => [ 1, "b", 3.14 ],
|
18
|
+
'e' => { 'foo' => 'bar' },
|
19
|
+
'g' => "\"\0\037",
|
20
|
+
'h' => 1000.0,
|
21
|
+
'i' => 0.001
|
22
|
+
})
|
23
|
+
JSON.parse(json)
|
24
|
+
end
|
25
|
+
expected_json = '{"a":2,"b":3.141,"c":"c","d":[1,"b",3.14],"e":{"foo":"bar"},' +
|
26
|
+
'"g":"\\"\\u0000\\u001f","h":1000.0,"i":0.001}'
|
27
|
+
assert_equal(JSON.parse(expected_json), r.take)
|
28
|
+
end;
|
29
|
+
end
|
30
|
+
end if defined?(Ractor)
|
data/tests/test_helper.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
case ENV['JSON']
|
2
2
|
when 'pure'
|
3
|
-
$:.unshift 'lib'
|
3
|
+
$:.unshift File.join(__dir__, '../lib')
|
4
4
|
require 'json/pure'
|
5
5
|
when 'ext'
|
6
|
-
$:.unshift 'ext', 'lib'
|
6
|
+
$:.unshift File.join(__dir__, '../ext'), File.join(__dir__, '../lib')
|
7
7
|
require 'json/ext'
|
8
8
|
else
|
9
|
-
$:.unshift 'ext', 'lib'
|
9
|
+
$:.unshift File.join(__dir__, '../ext'), File.join(__dir__, '../lib')
|
10
10
|
require 'json'
|
11
11
|
end
|
12
12
|
|
@@ -15,7 +15,3 @@ begin
|
|
15
15
|
require 'byebug'
|
16
16
|
rescue LoadError
|
17
17
|
end
|
18
|
-
if ENV['START_SIMPLECOV'].to_i == 1
|
19
|
-
require 'simplecov'
|
20
|
-
SimpleCov.start
|
21
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: test-unit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
description: This is a JSON implementation as a Ruby extension in C.
|
42
42
|
email: flori@ping.de
|
43
43
|
executables: []
|
@@ -48,19 +48,11 @@ extensions:
|
|
48
48
|
extra_rdoc_files:
|
49
49
|
- README.md
|
50
50
|
files:
|
51
|
-
- "./tests/test_helper.rb"
|
52
|
-
- ".gitignore"
|
53
|
-
- ".travis.yml"
|
54
51
|
- CHANGES.md
|
55
52
|
- Gemfile
|
56
|
-
-
|
53
|
+
- LICENSE
|
57
54
|
- README.md
|
58
|
-
- Rakefile
|
59
55
|
- VERSION
|
60
|
-
- data/example.json
|
61
|
-
- data/index.html
|
62
|
-
- data/prototype.js
|
63
|
-
- diagrams/.keep
|
64
56
|
- ext/json/ext/fbuffer/fbuffer.h
|
65
57
|
- ext/json/ext/generator/depend
|
66
58
|
- ext/json/ext/generator/extconf.rb
|
@@ -72,23 +64,7 @@ files:
|
|
72
64
|
- ext/json/ext/parser/parser.h
|
73
65
|
- ext/json/ext/parser/parser.rl
|
74
66
|
- ext/json/extconf.rb
|
75
|
-
- install.rb
|
76
|
-
- java/src/json/ext/ByteListTranscoder.java
|
77
|
-
- java/src/json/ext/Generator.java
|
78
|
-
- java/src/json/ext/GeneratorMethods.java
|
79
|
-
- java/src/json/ext/GeneratorService.java
|
80
|
-
- java/src/json/ext/GeneratorState.java
|
81
|
-
- java/src/json/ext/OptionsReader.java
|
82
|
-
- java/src/json/ext/Parser.java
|
83
|
-
- java/src/json/ext/Parser.rl
|
84
|
-
- java/src/json/ext/ParserService.java
|
85
|
-
- java/src/json/ext/RuntimeInfo.java
|
86
|
-
- java/src/json/ext/StringDecoder.java
|
87
|
-
- java/src/json/ext/StringEncoder.java
|
88
|
-
- java/src/json/ext/Utils.java
|
89
|
-
- json-java.gemspec
|
90
67
|
- json.gemspec
|
91
|
-
- json_pure.gemspec
|
92
68
|
- lib/json.rb
|
93
69
|
- lib/json/add/bigdecimal.rb
|
94
70
|
- lib/json/add/complex.rb
|
@@ -100,6 +76,7 @@ files:
|
|
100
76
|
- lib/json/add/range.rb
|
101
77
|
- lib/json/add/rational.rb
|
102
78
|
- lib/json/add/regexp.rb
|
79
|
+
- lib/json/add/set.rb
|
103
80
|
- lib/json/add/struct.rb
|
104
81
|
- lib/json/add/symbol.rb
|
105
82
|
- lib/json/add/time.rb
|
@@ -111,7 +88,6 @@ files:
|
|
111
88
|
- lib/json/pure/generator.rb
|
112
89
|
- lib/json/pure/parser.rb
|
113
90
|
- lib/json/version.rb
|
114
|
-
- references/rfc7159.txt
|
115
91
|
- tests/fixtures/fail10.json
|
116
92
|
- tests/fixtures/fail11.json
|
117
93
|
- tests/fixtures/fail12.json
|
@@ -128,7 +104,11 @@ files:
|
|
128
104
|
- tests/fixtures/fail25.json
|
129
105
|
- tests/fixtures/fail27.json
|
130
106
|
- tests/fixtures/fail28.json
|
107
|
+
- tests/fixtures/fail29.json
|
131
108
|
- tests/fixtures/fail3.json
|
109
|
+
- tests/fixtures/fail30.json
|
110
|
+
- tests/fixtures/fail31.json
|
111
|
+
- tests/fixtures/fail32.json
|
132
112
|
- tests/fixtures/fail4.json
|
133
113
|
- tests/fixtures/fail5.json
|
134
114
|
- tests/fixtures/fail6.json
|
@@ -152,18 +132,26 @@ files:
|
|
152
132
|
- tests/json_generic_object_test.rb
|
153
133
|
- tests/json_parser_test.rb
|
154
134
|
- tests/json_string_matching_test.rb
|
135
|
+
- tests/lib/core_assertions.rb
|
136
|
+
- tests/lib/envutil.rb
|
137
|
+
- tests/lib/find_executable.rb
|
138
|
+
- tests/lib/helper.rb
|
139
|
+
- tests/ractor_test.rb
|
155
140
|
- tests/test_helper.rb
|
156
|
-
- tools/diff.sh
|
157
|
-
- tools/fuzz.rb
|
158
|
-
- tools/server.rb
|
159
141
|
homepage: http://flori.github.com/json
|
160
142
|
licenses:
|
161
143
|
- Ruby
|
162
|
-
metadata:
|
163
|
-
|
144
|
+
metadata:
|
145
|
+
bug_tracker_uri: https://github.com/flori/json/issues
|
146
|
+
changelog_uri: https://github.com/flori/json/blob/master/CHANGES.md
|
147
|
+
documentation_uri: http://flori.github.io/json/doc/index.html
|
148
|
+
homepage_uri: http://flori.github.io/json/
|
149
|
+
source_code_uri: https://github.com/flori/json
|
150
|
+
wiki_uri: https://github.com/flori/json/wiki
|
151
|
+
post_install_message:
|
164
152
|
rdoc_options:
|
165
153
|
- "--title"
|
166
|
-
- JSON
|
154
|
+
- JSON implementation for Ruby
|
167
155
|
- "--main"
|
168
156
|
- README.md
|
169
157
|
require_paths:
|
@@ -172,17 +160,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
160
|
requirements:
|
173
161
|
- - ">="
|
174
162
|
- !ruby/object:Gem::Version
|
175
|
-
version: '
|
163
|
+
version: '2.0'
|
176
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
165
|
requirements:
|
178
166
|
- - ">="
|
179
167
|
- !ruby/object:Gem::Version
|
180
168
|
version: '0'
|
181
169
|
requirements: []
|
182
|
-
|
183
|
-
|
184
|
-
signing_key:
|
170
|
+
rubygems_version: 3.2.2
|
171
|
+
signing_key:
|
185
172
|
specification_version: 4
|
186
173
|
summary: JSON Implementation for Ruby
|
187
174
|
test_files:
|
188
|
-
-
|
175
|
+
- tests/test_helper.rb
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# Passes arguments to bundle install (http://gembundler.com/man/bundle-install.1.html)
|
2
|
-
#bundler_args: --binstubs
|
3
|
-
language: ruby
|
4
|
-
|
5
|
-
# Specify which ruby versions you wish to run your tests on, each version will be used
|
6
|
-
rvm:
|
7
|
-
- 1.9.3
|
8
|
-
- 2.0.0
|
9
|
-
- 2.1
|
10
|
-
- 2.2
|
11
|
-
- 2.3.3
|
12
|
-
- 2.4.0
|
13
|
-
- jruby
|
14
|
-
- ruby-head
|
15
|
-
matrix:
|
16
|
-
allow_failures:
|
17
|
-
- rvm: ruby-head
|
18
|
-
script: "bundle exec rake"
|
19
|
-
sudo: false
|
data/README-json-jruby.md
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
JSON-JRuby
|
2
|
-
==========
|
3
|
-
|
4
|
-
JSON-JRuby is a port of Florian Frank's native
|
5
|
-
[`json` library](http://json.rubyforge.org/) to JRuby.
|
6
|
-
It aims to be a perfect drop-in replacement for `json_pure`.
|
7
|
-
|
8
|
-
|
9
|
-
Development version
|
10
|
-
===================
|
11
|
-
|
12
|
-
The latest version is available from the
|
13
|
-
[Git repository](http://github.com/mernen/json-jruby/tree):
|
14
|
-
|
15
|
-
git clone git://github.com/mernen/json-jruby.git
|
16
|
-
|
17
|
-
|
18
|
-
Compiling
|
19
|
-
=========
|
20
|
-
|
21
|
-
You'll need JRuby version 1.2 or greater to build JSON-JRuby.
|
22
|
-
Its path must be set on the `jruby.dir` property of
|
23
|
-
`nbproject/project.properties` (defaults to `../jruby`).
|
24
|
-
|
25
|
-
Additionally, you'll need [Ant](http://ant.apache.org/), and
|
26
|
-
[Ragel](http://www.cs.queensu.ca/~thurston/ragel/) 6.4 or greater.
|
27
|
-
|
28
|
-
Then, from the folder where the sources are located, type:
|
29
|
-
|
30
|
-
ant clean jar
|
31
|
-
|
32
|
-
to clean any leftovers from previous builds and generate the `.jar` files.
|
33
|
-
To generate a RubyGem, specify the `gem` action rather than `jar`.
|