json 2.2.0 → 2.6.2

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.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +71 -5
  3. data/LICENSE +56 -0
  4. data/README.md +20 -4
  5. data/VERSION +1 -1
  6. data/ext/json/ext/generator/generator.c +222 -58
  7. data/ext/json/ext/generator/generator.h +5 -2
  8. data/ext/json/ext/parser/extconf.rb +26 -0
  9. data/ext/json/ext/parser/parser.c +2980 -1764
  10. data/ext/json/ext/parser/parser.h +6 -1
  11. data/ext/json/ext/parser/parser.rl +138 -43
  12. data/ext/json/extconf.rb +1 -0
  13. data/json.gemspec +0 -0
  14. data/lib/json/add/bigdecimal.rb +2 -2
  15. data/lib/json/add/complex.rb +2 -3
  16. data/lib/json/add/rational.rb +2 -3
  17. data/lib/json/add/regexp.rb +2 -2
  18. data/lib/json/common.rb +372 -125
  19. data/lib/json/pure/generator.rb +31 -10
  20. data/lib/json/pure/parser.rb +32 -6
  21. data/lib/json/version.rb +1 -1
  22. data/lib/json.rb +549 -29
  23. metadata +18 -109
  24. data/.gitignore +0 -17
  25. data/.travis.yml +0 -23
  26. data/Gemfile +0 -14
  27. data/README-json-jruby.md +0 -33
  28. data/Rakefile +0 -408
  29. data/diagrams/.keep +0 -0
  30. data/install.rb +0 -23
  31. data/java/src/json/ext/ByteListTranscoder.java +0 -166
  32. data/java/src/json/ext/Generator.java +0 -443
  33. data/java/src/json/ext/GeneratorMethods.java +0 -231
  34. data/java/src/json/ext/GeneratorService.java +0 -42
  35. data/java/src/json/ext/GeneratorState.java +0 -490
  36. data/java/src/json/ext/OptionsReader.java +0 -113
  37. data/java/src/json/ext/Parser.java +0 -2362
  38. data/java/src/json/ext/Parser.rl +0 -893
  39. data/java/src/json/ext/ParserService.java +0 -34
  40. data/java/src/json/ext/RuntimeInfo.java +0 -116
  41. data/java/src/json/ext/StringDecoder.java +0 -166
  42. data/java/src/json/ext/StringEncoder.java +0 -111
  43. data/java/src/json/ext/Utils.java +0 -88
  44. data/json-java.gemspec +0 -38
  45. data/json_pure.gemspec +0 -38
  46. data/lib/json/ext/.keep +0 -0
  47. data/references/rfc7159.txt +0 -899
  48. data/tests/fixtures/fail10.json +0 -1
  49. data/tests/fixtures/fail11.json +0 -1
  50. data/tests/fixtures/fail12.json +0 -1
  51. data/tests/fixtures/fail13.json +0 -1
  52. data/tests/fixtures/fail14.json +0 -1
  53. data/tests/fixtures/fail18.json +0 -1
  54. data/tests/fixtures/fail19.json +0 -1
  55. data/tests/fixtures/fail2.json +0 -1
  56. data/tests/fixtures/fail20.json +0 -1
  57. data/tests/fixtures/fail21.json +0 -1
  58. data/tests/fixtures/fail22.json +0 -1
  59. data/tests/fixtures/fail23.json +0 -1
  60. data/tests/fixtures/fail24.json +0 -1
  61. data/tests/fixtures/fail25.json +0 -1
  62. data/tests/fixtures/fail27.json +0 -2
  63. data/tests/fixtures/fail28.json +0 -2
  64. data/tests/fixtures/fail3.json +0 -1
  65. data/tests/fixtures/fail4.json +0 -1
  66. data/tests/fixtures/fail5.json +0 -1
  67. data/tests/fixtures/fail6.json +0 -1
  68. data/tests/fixtures/fail7.json +0 -1
  69. data/tests/fixtures/fail8.json +0 -1
  70. data/tests/fixtures/fail9.json +0 -1
  71. data/tests/fixtures/obsolete_fail1.json +0 -1
  72. data/tests/fixtures/pass1.json +0 -56
  73. data/tests/fixtures/pass15.json +0 -1
  74. data/tests/fixtures/pass16.json +0 -1
  75. data/tests/fixtures/pass17.json +0 -1
  76. data/tests/fixtures/pass2.json +0 -1
  77. data/tests/fixtures/pass26.json +0 -1
  78. data/tests/fixtures/pass3.json +0 -6
  79. data/tests/json_addition_test.rb +0 -203
  80. data/tests/json_common_interface_test.rb +0 -126
  81. data/tests/json_encoding_test.rb +0 -107
  82. data/tests/json_ext_parser_test.rb +0 -15
  83. data/tests/json_fixtures_test.rb +0 -32
  84. data/tests/json_generator_test.rb +0 -377
  85. data/tests/json_generic_object_test.rb +0 -82
  86. data/tests/json_parser_test.rb +0 -472
  87. data/tests/json_string_matching_test.rb +0 -38
  88. data/tests/test_helper.rb +0 -17
  89. data/tools/diff.sh +0 -18
  90. data/tools/fuzz.rb +0 -131
  91. data/tools/server.rb +0 -62
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d5aa01bc44bdf00e8465d5acbde009357987e98ac653672feba63b81f98dfc8
4
- data.tar.gz: 5845322c2daa41d815c4b845c6561d2addf86b459a5c093590317210d6d85901
3
+ metadata.gz: 21e09bba5bfe89e923363872b46bfb0ee800ff01e039e36b662008c85983983f
4
+ data.tar.gz: 2f319b945dd9f7510ce8dac412ab6d69f289942278cd298728af1cecb3b329c0
5
5
  SHA512:
6
- metadata.gz: f553341d9b8c4d20788255a35a48816a59cacb408f183e8a6009ab9326b66d80078961d4cc9da8e62155e4bb00f31dedddb449cf30afdb386ab6b49e248299dd
7
- data.tar.gz: e74601af87a7ec32952fd596b4981b0d26c4f96ddb88979a26b2fb06604dff204d38ba7c120cd0389756edb83cbd81b6fc569d16f5f7740b8b2915d63cdc8f22
6
+ metadata.gz: f7edf79e46c4a5e1b353f1463cad92af3198c8983247e9bb04751dd98ee714040455ebff17f03fe2b1a7928992885914d192e8b509673a26b47c8966822cb450
7
+ data.tar.gz: 5b086c18aac3d99ac1ef2ec5bdf66af841ba5dd6bc3a85e1e8e65ccb086458902b4a49fdb08a8acce978a46c13b82c23dc724450869f02898d6374d79750aca6
data/CHANGES.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # Changes
2
2
 
3
+ ### 2021-10-24 (2.6.1)
4
+
5
+ * Restore version.rb with 2.6.1
6
+
7
+ ### 2021-10-14 (2.6.0)
8
+
9
+ * Use `rb_enc_interned_str` if available to reduce allocations in `freeze: true` mode. #451.
10
+ * Bump required_ruby_version to 2.3.
11
+ * Fix compatibility with `GC.compact`.
12
+ * Fix some compilation warnings. #469
13
+
14
+ ## 2020-12-22 (2.5.1)
15
+
16
+ * Restore the compatibility for constants of JSON class.
17
+
18
+ ## 2020-12-22 (2.5.0)
19
+
20
+ * Ready to Ractor-safe at Ruby 3.0.
21
+
22
+ ## 2020-12-17 (2.4.1)
23
+
24
+ * Restore version.rb with 2.4.1
25
+
26
+ ## 2020-12-15 (2.4.0)
27
+
28
+ * Implement a freeze: parser option #447
29
+ * Fix an issue with generate_pretty and empty objects in the Ruby and Java implementations #449
30
+ * Fix JSON.load_file doc #448
31
+ * Fix pure parser with unclosed arrays / objects #425
32
+ * bundle the LICENSE file in the gem #444
33
+ * Add an option to escape forward slash character #405
34
+ * RDoc for JSON #439 #446 #442 #434 #433 #430
35
+
36
+ ## 2020-06-30 (2.3.1)
37
+
38
+ * Spelling and grammar fixes for comments. Pull request #191 by Josh
39
+ Kline.
40
+ * Enhance generic JSON and #generate docs. Pull request #347 by Victor
41
+ Shepelev.
42
+ * Add :nodoc: for GeneratorMethods. Pull request #349 by Victor Shepelev.
43
+ * Baseline changes to help (JRuby) development. Pull request #371 by Karol
44
+ Bucek.
45
+ * Add metadata for rubygems.org. Pull request #379 by Alexandre ZANNI.
46
+ * Remove invalid JSON.generate description from JSON module rdoc. Pull
47
+ request #384 by Jeremy Evans.
48
+ * Test with TruffleRuby in CI. Pull request #402 by Benoit Daloze.
49
+ * Rdoc enhancements. Pull request #413 by Burdette Lamar.
50
+ * Fixtures/ are not being tested... Pull request #416 by Marc-André
51
+ Lafortune.
52
+ * Use frozen string for hash key. Pull request #420 by Marc-André
53
+ Lafortune.
54
+ * Added :call-seq: to RDoc for some methods. Pull request #422 by Burdette
55
+ Lamar.
56
+ * Small typo fix. Pull request #423 by Marc-André Lafortune.
57
+
58
+ ## 2019-12-11 (2.3.0)
59
+ * Fix default of `create_additions` to always be `false` for `JSON(user_input)`
60
+ and `JSON.parse(user_input, nil)`.
61
+ Note that `JSON.load` remains with default `true` and is meant for internal
62
+ serialization of trusted data. [CVE-2020-10663]
63
+ * Fix passing args all #to_json in json/add/*.
64
+ * Fix encoding issues
65
+ * Fix issues of keyword vs positional parameter
66
+ * Fix JSON::Parser against bigdecimal updates
67
+ * Bug fixes to JRuby port
68
+
3
69
  ## 2019-02-21 (2.2.0)
4
70
  * Adds support for 2.6 BigDecimal and ruby standard library Set datetype.
5
71
 
@@ -28,7 +94,7 @@
28
94
 
29
95
  ## 2015-09-11 (2.0.0)
30
96
  * Now complies to newest JSON RFC 7159.
31
- * Implements compatibiliy to ruby 2.4 integer unification.
97
+ * Implements compatibility to ruby 2.4 integer unification.
32
98
  * Drops support for old rubies whose life has ended, that is rubies < 2.0.
33
99
  Also see https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/
34
100
  * There were still some mentions of dual GPL licensing in the source, but JSON
@@ -69,9 +135,9 @@
69
135
  ## 2013-02-04 (1.7.7)
70
136
  * Security fix for JSON create_additions default value and
71
137
  `JSON::GenericObject`. It should not be possible to create additions unless
72
- explicitely requested by setting the create_additions argument to true or
138
+ explicitly requested by setting the create_additions argument to true or
73
139
  using the JSON.load/dump interface. If `JSON::GenericObject` is supposed to
74
- be automatically deserialised, this has to be explicitely enabled by
140
+ be automatically deserialised, this has to be explicitly enabled by
75
141
  setting
76
142
  JSON::GenericObject.json_creatable = true
77
143
  as well.
@@ -217,7 +283,7 @@
217
283
  ## 2010-04-23 (1.4.0)
218
284
  * Major speed improvements and building with simplified
219
285
  directory/file-structure.
220
- * Extension should at least be comapatible with MRI, YARV and Rubinius.
286
+ * Extension should at least be compatible with MRI, YARV and Rubinius.
221
287
 
222
288
  ## 2010-04-07 (1.2.4)
223
289
  * Triger const_missing callback to make Rails' dynamic class loading work.
@@ -235,7 +301,7 @@
235
301
  strings in object names/keys.
236
302
 
237
303
  ## 2009-10-01 (1.2.0)
238
- * `fast_generate` now raises an exeception for nan and infinite floats.
304
+ * `fast_generate` now raises an exception for nan and infinite floats.
239
305
  * On Ruby 1.8 json supports parsing of UTF-8, UTF-16BE, UTF-16LE, UTF-32BE,
240
306
  and UTF-32LE JSON documents now. Under Ruby 1.9 the M17n conversion
241
307
  functions are used to convert from all supported encodings. ASCII-8BIT
data/LICENSE ADDED
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # JSON implementation for Ruby
2
2
 
3
- [![Travis Widget](http://travis-ci.org/flori/json.svg?branch=master)](https://travis-ci.org/flori/json)
3
+ [![CI](https://github.com/flori/json/actions/workflows/ci.yml/badge.svg)](https://github.com/flori/json/actions/workflows/ci.yml)
4
4
 
5
5
  ## Description
6
6
 
@@ -267,7 +267,7 @@ the `pp` library's `pp` methods.
267
267
 
268
268
  The script `tools/server.rb` contains a small example if you want to test, how
269
269
  receiving a JSON object from a webrick server in your browser with the
270
- javasript prototype library http://www.prototypejs.org works.
270
+ JavaScript prototype library http://www.prototypejs.org works.
271
271
 
272
272
  ## Speed Comparisons
273
273
 
@@ -294,7 +294,7 @@ extension:
294
294
  ```
295
295
 
296
296
  In the table above 1 is `JSON::Ext::Parser`, 2 is `YAML.load` with YAML
297
- compatbile JSON document, 3 is is `JSON::Pure::Parser`, and 4 is
297
+ compatible JSON document, 3 is is `JSON::Pure::Parser`, and 4 is
298
298
  `ActiveSupport::JSON.decode`. The ActiveSupport JSON-decoder converts the
299
299
  input first to YAML and then uses the YAML-parser, the conversion seems to
300
300
  slow it down so much that it is only as fast as the `JSON::Pure::Parser`!
@@ -390,6 +390,22 @@ Here are the median comparisons for completeness' sake:
390
390
  secs/call
391
391
  ```
392
392
 
393
+ ## Development
394
+
395
+ ### Release
396
+
397
+ Update the json.gemspec and json-java.gemspec.
398
+
399
+ ```
400
+ rbenv shell 2.6.5
401
+ rake build
402
+ gem push pkg/json-2.3.0.gem
403
+
404
+ rbenv shell jruby-9.2.9.0
405
+ rake build
406
+ gem push pkg/json-2.3.0-java.gem
407
+ ```
408
+
393
409
  ## Author
394
410
 
395
411
  Florian Frank <mailto:flori@ping.de>
@@ -406,4 +422,4 @@ The latest version of this library can be downloaded at
406
422
 
407
423
  Online Documentation should be located at
408
424
 
409
- * http://json.rubyforge.org
425
+ * https://www.rubydoc.info/gems/json
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.6.2