json 2.5.0 → 2.6.0

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +9 -5
  3. data/README.md +3 -3
  4. data/VERSION +1 -1
  5. data/ext/json/ext/generator/generator.c +1 -11
  6. data/ext/json/ext/parser/extconf.rb +1 -0
  7. data/ext/json/ext/parser/parser.c +2972 -1813
  8. data/ext/json/ext/parser/parser.h +5 -1
  9. data/ext/json/ext/parser/parser.rl +66 -28
  10. data/json.gemspec +2 -8
  11. data/lib/json/common.rb +2 -0
  12. data/lib/json/pure/parser.rb +1 -1
  13. data/lib/json/version.rb +1 -1
  14. data/lib/json.rb +1 -1
  15. metadata +6 -87
  16. data/Gemfile +0 -14
  17. data/lib/json/ext/.keep +0 -0
  18. data/tests/fixtures/fail10.json +0 -1
  19. data/tests/fixtures/fail11.json +0 -1
  20. data/tests/fixtures/fail12.json +0 -1
  21. data/tests/fixtures/fail13.json +0 -1
  22. data/tests/fixtures/fail14.json +0 -1
  23. data/tests/fixtures/fail18.json +0 -1
  24. data/tests/fixtures/fail19.json +0 -1
  25. data/tests/fixtures/fail2.json +0 -1
  26. data/tests/fixtures/fail20.json +0 -1
  27. data/tests/fixtures/fail21.json +0 -1
  28. data/tests/fixtures/fail22.json +0 -1
  29. data/tests/fixtures/fail23.json +0 -1
  30. data/tests/fixtures/fail24.json +0 -1
  31. data/tests/fixtures/fail25.json +0 -1
  32. data/tests/fixtures/fail27.json +0 -2
  33. data/tests/fixtures/fail28.json +0 -2
  34. data/tests/fixtures/fail29.json +0 -1
  35. data/tests/fixtures/fail3.json +0 -1
  36. data/tests/fixtures/fail30.json +0 -1
  37. data/tests/fixtures/fail31.json +0 -1
  38. data/tests/fixtures/fail32.json +0 -1
  39. data/tests/fixtures/fail4.json +0 -1
  40. data/tests/fixtures/fail5.json +0 -1
  41. data/tests/fixtures/fail6.json +0 -1
  42. data/tests/fixtures/fail7.json +0 -1
  43. data/tests/fixtures/fail8.json +0 -1
  44. data/tests/fixtures/fail9.json +0 -1
  45. data/tests/fixtures/obsolete_fail1.json +0 -1
  46. data/tests/fixtures/pass1.json +0 -56
  47. data/tests/fixtures/pass15.json +0 -1
  48. data/tests/fixtures/pass16.json +0 -1
  49. data/tests/fixtures/pass17.json +0 -1
  50. data/tests/fixtures/pass2.json +0 -1
  51. data/tests/fixtures/pass26.json +0 -1
  52. data/tests/fixtures/pass3.json +0 -6
  53. data/tests/json_addition_test.rb +0 -199
  54. data/tests/json_common_interface_test.rb +0 -169
  55. data/tests/json_encoding_test.rb +0 -107
  56. data/tests/json_ext_parser_test.rb +0 -15
  57. data/tests/json_fixtures_test.rb +0 -40
  58. data/tests/json_generator_test.rb +0 -399
  59. data/tests/json_generic_object_test.rb +0 -82
  60. data/tests/json_parser_test.rb +0 -497
  61. data/tests/json_string_matching_test.rb +0 -38
  62. data/tests/lib/core_assertions.rb +0 -763
  63. data/tests/lib/envutil.rb +0 -365
  64. data/tests/lib/find_executable.rb +0 -22
  65. data/tests/lib/helper.rb +0 -4
  66. data/tests/ractor_test.rb +0 -30
  67. data/tests/test_helper.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae21d647db9c8291ae1fd3137d82feff3c0f7d575c244bd23902332179ef660b
4
- data.tar.gz: d51e458a1de384797e9a11ca9413f74ff58f067e4478a4d54d220527387914fd
3
+ metadata.gz: dcc1346522e82980a0a5891f93738a33d0d367b0013e22440a85282b6d56721e
4
+ data.tar.gz: a7d4a06c398e9a550664e29096f85eaab0f7007bac945e69d3b869b24df2017b
5
5
  SHA512:
6
- metadata.gz: f7b8eaa3f4cb78f26cdb0a4629529372baa32b9e30f16bcfe8955581e6e886561f3da4b396fd711a1ffdad04dec9657f4f0953bf4283a99d9c5243353272ad11
7
- data.tar.gz: fe145361cd4b6bfd2fdb038ae5ab373d9f641893f43dab26460bc085833687ce78e105f2b18cff2c11d4cf974a32da082954d0117fffbeb8f75548272392201b
6
+ metadata.gz: 91235d83102ee7de2a1263a6b4d351fa61a3fa9440a31dc00cd391995721e333e609ab569f93ec9b2ad9e6b68a721d96a18af8e515d77d11c81d7626b82ab0f3
7
+ data.tar.gz: f2dcfe70be72b2df3567ee35bc3f4ecbf170ed6022362bc31cab151609ec3e3a0ef7aa339e81c0816987b25c7132fa222e1a51bc19af8cf4bf8143d66d5ed157
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2020-12-22 (2.5.1)
4
+
5
+ * Restore the compatibility for constants of JSON class.
6
+
3
7
  ## 2020-12-22 (2.5.0)
4
8
 
5
9
  * Ready to Ractor-safe at Ruby 3.0.
@@ -79,7 +83,7 @@
79
83
 
80
84
  ## 2015-09-11 (2.0.0)
81
85
  * Now complies to newest JSON RFC 7159.
82
- * Implements compatibiliy to ruby 2.4 integer unification.
86
+ * Implements compatibility to ruby 2.4 integer unification.
83
87
  * Drops support for old rubies whose life has ended, that is rubies < 2.0.
84
88
  Also see https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/
85
89
  * There were still some mentions of dual GPL licensing in the source, but JSON
@@ -120,9 +124,9 @@
120
124
  ## 2013-02-04 (1.7.7)
121
125
  * Security fix for JSON create_additions default value and
122
126
  `JSON::GenericObject`. It should not be possible to create additions unless
123
- explicitely requested by setting the create_additions argument to true or
127
+ explicitly requested by setting the create_additions argument to true or
124
128
  using the JSON.load/dump interface. If `JSON::GenericObject` is supposed to
125
- be automatically deserialised, this has to be explicitely enabled by
129
+ be automatically deserialised, this has to be explicitly enabled by
126
130
  setting
127
131
  JSON::GenericObject.json_creatable = true
128
132
  as well.
@@ -268,7 +272,7 @@
268
272
  ## 2010-04-23 (1.4.0)
269
273
  * Major speed improvements and building with simplified
270
274
  directory/file-structure.
271
- * Extension should at least be comapatible with MRI, YARV and Rubinius.
275
+ * Extension should at least be compatible with MRI, YARV and Rubinius.
272
276
 
273
277
  ## 2010-04-07 (1.2.4)
274
278
  * Triger const_missing callback to make Rails' dynamic class loading work.
@@ -286,7 +290,7 @@
286
290
  strings in object names/keys.
287
291
 
288
292
  ## 2009-10-01 (1.2.0)
289
- * `fast_generate` now raises an exeception for nan and infinite floats.
293
+ * `fast_generate` now raises an exception for nan and infinite floats.
290
294
  * On Ruby 1.8 json supports parsing of UTF-8, UTF-16BE, UTF-16LE, UTF-32BE,
291
295
  and UTF-32LE JSON documents now. Under Ruby 1.9 the M17n conversion
292
296
  functions are used to convert from all supported encodings. ASCII-8BIT
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`!
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.6.0
@@ -1,11 +1,6 @@
1
1
  #include "../fbuffer/fbuffer.h"
2
2
  #include "generator.h"
3
3
 
4
- #ifdef HAVE_RUBY_ENCODING_H
5
- static VALUE CEncoding_UTF_8;
6
- static ID i_encoding, i_encode;
7
- #endif
8
-
9
4
  static VALUE mJSON, mExt, mGenerator, cState, mGeneratorMethods, mObject,
10
5
  mHash, mArray,
11
6
  #ifdef RUBY_INTEGER_UNIFICATION
@@ -948,7 +943,7 @@ static void generate_json_string(FBuffer *buffer, VALUE Vstate, JSON_Generator_S
948
943
  fbuffer_append_char(buffer, '"');
949
944
  #ifdef HAVE_RUBY_ENCODING_H
950
945
  if (!enc_utf8_compatible_p(rb_enc_get(obj))) {
951
- obj = rb_str_encode(obj, CEncoding_UTF_8, 0, Qnil);
946
+ obj = rb_str_export_to_enc(obj, rb_utf8_encoding());
952
947
  }
953
948
  #endif
954
949
  if (state->ascii_only) {
@@ -1610,9 +1605,4 @@ void Init_generator(void)
1610
1605
  i_match = rb_intern("match");
1611
1606
  i_keys = rb_intern("keys");
1612
1607
  i_dup = rb_intern("dup");
1613
- #ifdef HAVE_RUBY_ENCODING_H
1614
- CEncoding_UTF_8 = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-8"));
1615
- i_encoding = rb_intern("encoding");
1616
- i_encode = rb_intern("encode");
1617
- #endif
1618
1608
  }
@@ -2,6 +2,7 @@
2
2
  require 'mkmf'
3
3
 
4
4
  have_func("rb_enc_raise", "ruby.h")
5
+ have_func("rb_enc_interned_str", "ruby.h")
5
6
 
6
7
  # checking if String#-@ (str_uminus) dedupes... '
7
8
  begin