json 2.5.1 → 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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +5 -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/pure/parser.rb +1 -1
  12. data/lib/json/version.rb +1 -1
  13. data/lib/json.rb +1 -1
  14. metadata +6 -87
  15. data/Gemfile +0 -14
  16. data/lib/json/ext/.keep +0 -0
  17. data/tests/fixtures/fail10.json +0 -1
  18. data/tests/fixtures/fail11.json +0 -1
  19. data/tests/fixtures/fail12.json +0 -1
  20. data/tests/fixtures/fail13.json +0 -1
  21. data/tests/fixtures/fail14.json +0 -1
  22. data/tests/fixtures/fail18.json +0 -1
  23. data/tests/fixtures/fail19.json +0 -1
  24. data/tests/fixtures/fail2.json +0 -1
  25. data/tests/fixtures/fail20.json +0 -1
  26. data/tests/fixtures/fail21.json +0 -1
  27. data/tests/fixtures/fail22.json +0 -1
  28. data/tests/fixtures/fail23.json +0 -1
  29. data/tests/fixtures/fail24.json +0 -1
  30. data/tests/fixtures/fail25.json +0 -1
  31. data/tests/fixtures/fail27.json +0 -2
  32. data/tests/fixtures/fail28.json +0 -2
  33. data/tests/fixtures/fail29.json +0 -1
  34. data/tests/fixtures/fail3.json +0 -1
  35. data/tests/fixtures/fail30.json +0 -1
  36. data/tests/fixtures/fail31.json +0 -1
  37. data/tests/fixtures/fail32.json +0 -1
  38. data/tests/fixtures/fail4.json +0 -1
  39. data/tests/fixtures/fail5.json +0 -1
  40. data/tests/fixtures/fail6.json +0 -1
  41. data/tests/fixtures/fail7.json +0 -1
  42. data/tests/fixtures/fail8.json +0 -1
  43. data/tests/fixtures/fail9.json +0 -1
  44. data/tests/fixtures/obsolete_fail1.json +0 -1
  45. data/tests/fixtures/pass1.json +0 -56
  46. data/tests/fixtures/pass15.json +0 -1
  47. data/tests/fixtures/pass16.json +0 -1
  48. data/tests/fixtures/pass17.json +0 -1
  49. data/tests/fixtures/pass2.json +0 -1
  50. data/tests/fixtures/pass26.json +0 -1
  51. data/tests/fixtures/pass3.json +0 -6
  52. data/tests/json_addition_test.rb +0 -199
  53. data/tests/json_common_interface_test.rb +0 -169
  54. data/tests/json_encoding_test.rb +0 -107
  55. data/tests/json_ext_parser_test.rb +0 -15
  56. data/tests/json_fixtures_test.rb +0 -40
  57. data/tests/json_generator_test.rb +0 -399
  58. data/tests/json_generic_object_test.rb +0 -82
  59. data/tests/json_parser_test.rb +0 -497
  60. data/tests/json_string_matching_test.rb +0 -38
  61. data/tests/lib/core_assertions.rb +0 -763
  62. data/tests/lib/envutil.rb +0 -365
  63. data/tests/lib/find_executable.rb +0 -22
  64. data/tests/lib/helper.rb +0 -4
  65. data/tests/ractor_test.rb +0 -30
  66. data/tests/test_helper.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ba367cf703870f72ec5de7af43e713095df4b9c88cb0ae12a4c10455052383a
4
- data.tar.gz: 622fc0230b9a26ddde47fb3e81c2cf2f0143c22cbfd2429019db1a0f9eef5aaa
3
+ metadata.gz: dcc1346522e82980a0a5891f93738a33d0d367b0013e22440a85282b6d56721e
4
+ data.tar.gz: a7d4a06c398e9a550664e29096f85eaab0f7007bac945e69d3b869b24df2017b
5
5
  SHA512:
6
- metadata.gz: 1cab7c9113f03333b720a039fd065d5dd376ab3b4dda1630ccf316ee72121ed4a8abfc06a576be524ce7a86b78e9af917b507fbe95411efef11a563da95295c4
7
- data.tar.gz: 68b7cec95107a831286fc3ff36971cd9cc0efbc29157bc0df95a16238b5594214ffca0d417f2dd9011f9e26bf4e163e01e179cbf06f8c053df68c4d60f2416cc
6
+ metadata.gz: 91235d83102ee7de2a1263a6b4d351fa61a3fa9440a31dc00cd391995721e333e609ab569f93ec9b2ad9e6b68a721d96a18af8e515d77d11c81d7626b82ab0f3
7
+ data.tar.gz: f2dcfe70be72b2df3567ee35bc3f4ecbf170ed6022362bc31cab151609ec3e3a0ef7aa339e81c0816987b25c7132fa222e1a51bc19af8cf4bf8143d66d5ed157
data/CHANGES.md CHANGED
@@ -83,7 +83,7 @@
83
83
 
84
84
  ## 2015-09-11 (2.0.0)
85
85
  * Now complies to newest JSON RFC 7159.
86
- * Implements compatibiliy to ruby 2.4 integer unification.
86
+ * Implements compatibility to ruby 2.4 integer unification.
87
87
  * Drops support for old rubies whose life has ended, that is rubies < 2.0.
88
88
  Also see https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/
89
89
  * There were still some mentions of dual GPL licensing in the source, but JSON
@@ -124,9 +124,9 @@
124
124
  ## 2013-02-04 (1.7.7)
125
125
  * Security fix for JSON create_additions default value and
126
126
  `JSON::GenericObject`. It should not be possible to create additions unless
127
- explicitely requested by setting the create_additions argument to true or
127
+ explicitly requested by setting the create_additions argument to true or
128
128
  using the JSON.load/dump interface. If `JSON::GenericObject` is supposed to
129
- be automatically deserialised, this has to be explicitely enabled by
129
+ be automatically deserialised, this has to be explicitly enabled by
130
130
  setting
131
131
  JSON::GenericObject.json_creatable = true
132
132
  as well.
@@ -272,7 +272,7 @@
272
272
  ## 2010-04-23 (1.4.0)
273
273
  * Major speed improvements and building with simplified
274
274
  directory/file-structure.
275
- * Extension should at least be comapatible with MRI, YARV and Rubinius.
275
+ * Extension should at least be compatible with MRI, YARV and Rubinius.
276
276
 
277
277
  ## 2010-04-07 (1.2.4)
278
278
  * Triger const_missing callback to make Rails' dynamic class loading work.
@@ -290,7 +290,7 @@
290
290
  strings in object names/keys.
291
291
 
292
292
  ## 2009-10-01 (1.2.0)
293
- * `fast_generate` now raises an exeception for nan and infinite floats.
293
+ * `fast_generate` now raises an exception for nan and infinite floats.
294
294
  * On Ruby 1.8 json supports parsing of UTF-8, UTF-16BE, UTF-16LE, UTF-32BE,
295
295
  and UTF-32LE JSON documents now. Under Ruby 1.9 the M17n conversion
296
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.1
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