json 1.0.0 → 2.7.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 (109) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES.md +503 -0
  3. data/LICENSE +56 -0
  4. data/README.md +416 -0
  5. data/ext/json/ext/fbuffer/fbuffer.h +187 -0
  6. data/ext/json/ext/generator/depend +1 -0
  7. data/ext/json/ext/generator/extconf.rb +2 -7
  8. data/ext/json/ext/generator/generator.c +1312 -338
  9. data/ext/json/ext/generator/generator.h +177 -0
  10. data/ext/json/ext/parser/depend +1 -0
  11. data/ext/json/ext/parser/extconf.rb +28 -5
  12. data/ext/json/ext/parser/parser.c +1349 -689
  13. data/ext/json/ext/parser/parser.h +96 -0
  14. data/ext/json/ext/parser/parser.rl +644 -188
  15. data/ext/json/extconf.rb +3 -0
  16. data/json.gemspec +68 -0
  17. data/lib/json/add/bigdecimal.rb +58 -0
  18. data/lib/json/add/complex.rb +51 -0
  19. data/lib/json/add/core.rb +12 -0
  20. data/lib/json/add/date.rb +54 -0
  21. data/lib/json/add/date_time.rb +67 -0
  22. data/lib/json/add/exception.rb +49 -0
  23. data/lib/json/add/ostruct.rb +54 -0
  24. data/lib/json/add/range.rb +54 -0
  25. data/lib/json/add/rational.rb +49 -0
  26. data/lib/json/add/regexp.rb +48 -0
  27. data/lib/json/add/set.rb +48 -0
  28. data/lib/json/add/struct.rb +52 -0
  29. data/lib/json/add/symbol.rb +48 -0
  30. data/lib/json/add/time.rb +59 -0
  31. data/lib/json/common.rb +588 -74
  32. data/lib/json/ext.rb +3 -1
  33. data/lib/json/generic_object.rb +75 -0
  34. data/lib/json/pure/generator.rb +311 -119
  35. data/lib/json/pure/parser.rb +182 -55
  36. data/lib/json/pure.rb +5 -65
  37. data/lib/json/version.rb +2 -1
  38. data/lib/json.rb +583 -196
  39. metadata +78 -137
  40. data/CHANGES +0 -25
  41. data/GPL +0 -340
  42. data/README +0 -77
  43. data/Rakefile +0 -250
  44. data/TODO +0 -1
  45. data/VERSION +0 -1
  46. data/benchmarks/benchmark.txt +0 -133
  47. data/benchmarks/benchmark_generator.rb +0 -44
  48. data/benchmarks/benchmark_parser.rb +0 -22
  49. data/benchmarks/benchmark_rails.rb +0 -26
  50. data/bin/edit_json.rb +0 -11
  51. data/data/example.json +0 -1
  52. data/data/index.html +0 -37
  53. data/data/prototype.js +0 -2515
  54. data/ext/json/ext/generator/Makefile +0 -149
  55. data/ext/json/ext/generator/unicode.c +0 -184
  56. data/ext/json/ext/generator/unicode.h +0 -40
  57. data/ext/json/ext/parser/Makefile +0 -149
  58. data/ext/json/ext/parser/unicode.c +0 -156
  59. data/ext/json/ext/parser/unicode.h +0 -44
  60. data/install.rb +0 -26
  61. data/lib/json/Array.xpm +0 -21
  62. data/lib/json/FalseClass.xpm +0 -21
  63. data/lib/json/Hash.xpm +0 -21
  64. data/lib/json/Key.xpm +0 -73
  65. data/lib/json/NilClass.xpm +0 -21
  66. data/lib/json/Numeric.xpm +0 -28
  67. data/lib/json/String.xpm +0 -96
  68. data/lib/json/TrueClass.xpm +0 -21
  69. data/lib/json/editor.rb +0 -1207
  70. data/lib/json/json.xpm +0 -1499
  71. data/tests/fixtures/fail1.json +0 -1
  72. data/tests/fixtures/fail10.json +0 -1
  73. data/tests/fixtures/fail11.json +0 -1
  74. data/tests/fixtures/fail12.json +0 -1
  75. data/tests/fixtures/fail13.json +0 -1
  76. data/tests/fixtures/fail14.json +0 -1
  77. data/tests/fixtures/fail15.json +0 -1
  78. data/tests/fixtures/fail16.json +0 -1
  79. data/tests/fixtures/fail17.json +0 -1
  80. data/tests/fixtures/fail19.json +0 -1
  81. data/tests/fixtures/fail2.json +0 -1
  82. data/tests/fixtures/fail20.json +0 -1
  83. data/tests/fixtures/fail21.json +0 -1
  84. data/tests/fixtures/fail22.json +0 -1
  85. data/tests/fixtures/fail23.json +0 -1
  86. data/tests/fixtures/fail24.json +0 -1
  87. data/tests/fixtures/fail25.json +0 -1
  88. data/tests/fixtures/fail26.json +0 -1
  89. data/tests/fixtures/fail27.json +0 -2
  90. data/tests/fixtures/fail28.json +0 -2
  91. data/tests/fixtures/fail3.json +0 -1
  92. data/tests/fixtures/fail4.json +0 -1
  93. data/tests/fixtures/fail5.json +0 -1
  94. data/tests/fixtures/fail6.json +0 -1
  95. data/tests/fixtures/fail7.json +0 -1
  96. data/tests/fixtures/fail8.json +0 -1
  97. data/tests/fixtures/fail9.json +0 -1
  98. data/tests/fixtures/pass1.json +0 -56
  99. data/tests/fixtures/pass18.json +0 -1
  100. data/tests/fixtures/pass2.json +0 -1
  101. data/tests/fixtures/pass3.json +0 -6
  102. data/tests/runner.rb +0 -24
  103. data/tests/test_json.rb +0 -235
  104. data/tests/test_json_addition.rb +0 -94
  105. data/tests/test_json_fixtures.rb +0 -30
  106. data/tests/test_json_generate.rb +0 -81
  107. data/tests/test_json_unicode.rb +0 -55
  108. data/tools/fuzz.rb +0 -133
  109. data/tools/server.rb +0 -62
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1ae811d90e98bbf8438c5abff24a9eabd5ef9c929115c14d3616a0c23f3a3fa2
4
+ data.tar.gz: eaa6afeb5ed814f5272bf54172b98ab217b26f850cb91d6fb081a9551237030c
5
+ SHA512:
6
+ metadata.gz: c4119c5fdb66b553ee50cab0185cdec0ff7b09f102cfec8faa28efe2a6042d1e5cb46ada853afdc47b76707b5b180e0f68fb039e08e329935434716e2419b8e1
7
+ data.tar.gz: f7d69e1e729e4b37687358bd6ebf81e8909fe4418bfff5c8a2d676b070d6af979146d0b18c01820d5bd4a7f567a62cbb90d0e164e96d05c0e99d9968657467c0
data/CHANGES.md ADDED
@@ -0,0 +1,503 @@
1
+ # Changes
2
+
3
+ ### 2023-12-05 (2.7.1)
4
+
5
+ * JSON.dump: handle unenclosed hashes regression #554
6
+ * Overload kwargs in JSON.dump #556
7
+ * [DOC] RDoc for additions #557
8
+ * Fix JSON.dump overload combination #558
9
+
10
+ ### 2023-12-01 (2.7.0)
11
+
12
+ * Add a strict option to Generator #519
13
+ * `escape_slash` option was renamed as `script_safe` and now also escape U+2028 and U+2029. `escape_slash` is now an alias of `script_safe` #525
14
+ * Remove unnecessary initialization of create_id in JSON.parse() #454
15
+ * Improvements to Hash#to_json in pure implementation generator #203
16
+ * Use ruby_xfree to free buffers #518
17
+ * Fix "unexpected token" offset for Infinity #507
18
+ * Avoid using deprecated BigDecimal.new on JRuby #546
19
+ * Removed code for Ruby 1.8 #540
20
+ * Rename JSON::ParseError to JSON:ParserError #530
21
+ * Call super in included hook #486
22
+ * JRuby requires a minimum of Java 8 #516
23
+ * Always indent even if empty #517
24
+
25
+ ### 2022-11-30 (2.6.3)
26
+
27
+ * bugfix json/pure mixing escaped with literal unicode raises Encoding::CompatibilityError #483
28
+ * Stop including the parser source __LINE__ in exceptions #470
29
+
30
+ ### 2022-11-17 (2.6.2)
31
+
32
+ * Remove unknown keyword arg from DateTime.parse #488
33
+ * Ignore java artifacts by @hsbt #489
34
+ * Fix parser bug for empty string allocation #496
35
+
36
+ ### 2021-10-24 (2.6.1)
37
+
38
+ * Restore version.rb with 2.6.1
39
+
40
+ ### 2021-10-14 (2.6.0)
41
+
42
+ * Use `rb_enc_interned_str` if available to reduce allocations in `freeze: true` mode. #451.
43
+ * Bump required_ruby_version to 2.3.
44
+ * Fix compatibility with `GC.compact`.
45
+ * Fix some compilation warnings. #469
46
+
47
+ ## 2020-12-22 (2.5.1)
48
+
49
+ * Restore the compatibility for constants of JSON class.
50
+
51
+ ## 2020-12-22 (2.5.0)
52
+
53
+ * Ready to Ractor-safe at Ruby 3.0.
54
+
55
+ ## 2020-12-17 (2.4.1)
56
+
57
+ * Restore version.rb with 2.4.1
58
+
59
+ ## 2020-12-15 (2.4.0)
60
+
61
+ * Implement a freeze: parser option #447
62
+ * Fix an issue with generate_pretty and empty objects in the Ruby and Java implementations #449
63
+ * Fix JSON.load_file doc #448
64
+ * Fix pure parser with unclosed arrays / objects #425
65
+ * bundle the LICENSE file in the gem #444
66
+ * Add an option to escape forward slash character #405
67
+ * RDoc for JSON #439 #446 #442 #434 #433 #430
68
+
69
+ ## 2020-06-30 (2.3.1)
70
+
71
+ * Spelling and grammar fixes for comments. Pull request #191 by Josh
72
+ Kline.
73
+ * Enhance generic JSON and #generate docs. Pull request #347 by Victor
74
+ Shepelev.
75
+ * Add :nodoc: for GeneratorMethods. Pull request #349 by Victor Shepelev.
76
+ * Baseline changes to help (JRuby) development. Pull request #371 by Karol
77
+ Bucek.
78
+ * Add metadata for rubygems.org. Pull request #379 by Alexandre ZANNI.
79
+ * Remove invalid JSON.generate description from JSON module rdoc. Pull
80
+ request #384 by Jeremy Evans.
81
+ * Test with TruffleRuby in CI. Pull request #402 by Benoit Daloze.
82
+ * Rdoc enhancements. Pull request #413 by Burdette Lamar.
83
+ * Fixtures/ are not being tested... Pull request #416 by Marc-André
84
+ Lafortune.
85
+ * Use frozen string for hash key. Pull request #420 by Marc-André
86
+ Lafortune.
87
+ * Added :call-seq: to RDoc for some methods. Pull request #422 by Burdette
88
+ Lamar.
89
+ * Small typo fix. Pull request #423 by Marc-André Lafortune.
90
+
91
+ ## 2019-12-11 (2.3.0)
92
+ * Fix default of `create_additions` to always be `false` for `JSON(user_input)`
93
+ and `JSON.parse(user_input, nil)`.
94
+ Note that `JSON.load` remains with default `true` and is meant for internal
95
+ serialization of trusted data. [CVE-2020-10663]
96
+ * Fix passing args all #to_json in json/add/*.
97
+ * Fix encoding issues
98
+ * Fix issues of keyword vs positional parameter
99
+ * Fix JSON::Parser against bigdecimal updates
100
+ * Bug fixes to JRuby port
101
+
102
+ ## 2019-02-21 (2.2.0)
103
+ * Adds support for 2.6 BigDecimal and ruby standard library Set datetype.
104
+
105
+ ## 2017-04-18 (2.1.0)
106
+ * Allow passing of `decimal_class` option to specify a class as which to parse
107
+ JSON float numbers.
108
+ ## 2017-03-23 (2.0.4)
109
+ * Raise exception for incomplete unicode surrogates/character escape
110
+ sequences. This problem was reported by Daniel Gollahon (dgollahon).
111
+ * Fix arbitrary heap exposure problem. This problem was reported by Ahmad
112
+ Sherif (ahmadsherif).
113
+
114
+ ## 2017-01-12 (2.0.3)
115
+ * Set `required_ruby_version` to 1.9
116
+ * Some small fixes
117
+
118
+ ## 2016-07-26 (2.0.2)
119
+ * Specify `required_ruby_version` for json\_pure.
120
+ * Fix issue #295 failure when parsing frozen strings.
121
+
122
+ ## 2016-07-01 (2.0.1)
123
+ * Fix problem when requiring json\_pure and Parser constant was defined top
124
+ level.
125
+ * Add `RB_GC_GUARD` to avoid possible GC problem via Pete Johns.
126
+ * Store `current_nesting` on stack by Aaron Patterson.
127
+
128
+ ## 2015-09-11 (2.0.0)
129
+ * Now complies to newest JSON RFC 7159.
130
+ * Implements compatibility to ruby 2.4 integer unification.
131
+ * Drops support for old rubies whose life has ended, that is rubies < 2.0.
132
+ Also see https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/
133
+ * There were still some mentions of dual GPL licensing in the source, but JSON
134
+ has just the Ruby license that itself includes an explicit dual-licensing
135
+ clause that allows covered software to be distributed under the terms of
136
+ the Simplified BSD License instead for all ruby versions >= 1.9.3. This is
137
+ however a GPL compatible license according to the Free Software Foundation.
138
+ I changed these mentions to be consistent with the Ruby license setting in
139
+ the gemspec files which were already correct now.
140
+
141
+ ## 2017-01-13 (1.8.6)
142
+ * Be compatible with ancient ruby 1.8 (maybe?)
143
+
144
+ ## 2015-09-11 (1.8.5)
145
+ * Be compatible with ruby 2.4.0
146
+ * There were still some mentions of dual GPL licensing in the source, but JSON
147
+ has just the Ruby license that itself includes an explicit dual-licensing
148
+ clause that allows covered software to be distributed under the terms of
149
+ the Simplified BSD License instead for all ruby versions >= 1.9.3. This is
150
+ however a GPL compatible license according to the Free Software Foundation.
151
+ I changed these mentions to be consistent with the Ruby license setting in
152
+ the gemspec files which were already correct now.
153
+
154
+ ## 2015-06-01 (1.8.3)
155
+ * Fix potential memory leak, thx to nobu.
156
+
157
+ ## 2015-01-08 (1.8.2)
158
+ * Some performance improvements by Vipul A M <vipulnsward@gmail.com>.
159
+ * Fix by Jason R. Clark <jclark@newrelic.com> to avoid mutation of
160
+ `JSON.dump_default_options`.
161
+ * More tests by Michael Mac-Vicar <mmacvicar@gmail.com> and fixing
162
+ `space_before` accessor in generator.
163
+ * Performance on Jruby improved by Ben Browning <bbrownin@redhat.com>.
164
+ * Some fixes to be compatible with the new Ruby 2.2 by Zachary Scott <e@zzak.io>
165
+ and SHIBATA Hiroshi <hsbt@ruby-lang.org>.
166
+
167
+ ## 2013-05-13 (1.8.1)
168
+ * Remove Rubinius exception since transcoding should be working now.
169
+
170
+ ## 2013-05-13 (1.8.0)
171
+ * Fix https://github.com/flori/json/issues/162 reported by Marc-Andre
172
+ Lafortune <github_rocks@marc-andre.ca>. Thanks!
173
+ * Applied patches by Yui NARUSE <naruse@airemix.jp> to suppress warning with
174
+ -Wchar-subscripts and better validate UTF-8 strings.
175
+ * Applied patch by ginriki@github to remove unnecessary if.
176
+ * Add load/dump interface to `JSON::GenericObject` to make
177
+ serialize :some_attribute, `JSON::GenericObject`
178
+ work in Rails active models for convenient `SomeModel#some_attribute.foo.bar`
179
+ access to serialised JSON data.
180
+
181
+ ## 2013-02-04 (1.7.7)
182
+ * Security fix for JSON create_additions default value and
183
+ `JSON::GenericObject`. It should not be possible to create additions unless
184
+ explicitly requested by setting the create_additions argument to true or
185
+ using the JSON.load/dump interface. If `JSON::GenericObject` is supposed to
186
+ be automatically deserialised, this has to be explicitly enabled by
187
+ setting
188
+ JSON::GenericObject.json_creatable = true
189
+ as well.
190
+ * Remove useless assert in fbuffer implementation.
191
+ * Apply patch attached to https://github.com/flori/json/issues#issue/155
192
+ provided by John Shahid <jvshahid@gmail.com>, Thx!
193
+ * Add license information to rubygems spec data, reported by Jordi Massaguer Pla <jmassaguerpla@suse.de>.
194
+ * Improve documentation, thx to Zachary Scott <zachary@zacharyscott.net>.
195
+
196
+ ## 2012-11-29 (1.7.6)
197
+ * Add `GeneratorState#merge` alias for JRuby, fix state accessor methods. Thx to
198
+ jvshahid@github.
199
+ * Increase hash likeness of state objects.
200
+
201
+ ## 2012-08-17 (1.7.5)
202
+ * Fix compilation of extension on older rubies.
203
+
204
+ ## 2012-07-26 (1.7.4)
205
+ * Fix compilation problem on AIX, see https://github.com/flori/json/issues/142
206
+
207
+ ## 2012-05-12 (1.7.3)
208
+ * Work around Rubinius encoding issues using iconv for conversion instead.
209
+
210
+ ## 2012-05-11 (1.7.2)
211
+ * Fix some encoding issues, that cause problems for the pure and the
212
+ extension variant in jruby 1.9 mode.
213
+
214
+ ## 2012-04-28 (1.7.1)
215
+ * Some small fixes for building
216
+
217
+ ## 2012-04-28 (1.7.0)
218
+ * Add `JSON::GenericObject` for method access to objects transmitted via JSON.
219
+
220
+ ## 2012-04-27 (1.6.7)
221
+ * Fix possible crash when trying to parse nil value.
222
+
223
+ ## 2012-02-11 (1.6.6)
224
+ * Propagate src encoding to values made from it (fixes 1.9 mode converting
225
+ everything to ascii-8bit; harmless for 1.8 mode too) (Thomas E. Enebo
226
+ <tom.enebo@gmail.com>), should fix
227
+ https://github.com/flori/json/issues#issue/119.
228
+ * Fix https://github.com/flori/json/issues#issue/124 Thx to Jason Hutchens.
229
+ * Fix https://github.com/flori/json/issues#issue/117
230
+
231
+ ## 2012-01-15 (1.6.5)
232
+ * Vit Ondruch <v.ondruch@tiscali.cz> reported a bug that shows up when using
233
+ optimisation under GCC 4.7. Thx to him, Bohuslav Kabrda
234
+ <bkabrda@redhat.com> and Yui NARUSE <naruse@airemix.jp> for debugging and
235
+ developing a patch fix.
236
+
237
+ ## 2011-12-24 (1.6.4)
238
+ * Patches that improve speed on JRuby contributed by Charles Oliver Nutter
239
+ <headius@headius.com>.
240
+ * Support `object_class`/`array_class` with duck typed hash/array.
241
+
242
+ ## 2011-12-01 (1.6.3)
243
+ * Let `JSON.load('')` return nil as well to make mysql text columns (default to
244
+ `''`) work better for serialization.
245
+
246
+ ## 2011-11-21 (1.6.2)
247
+ * Add support for OpenStruct and BigDecimal.
248
+ * Fix bug when parsing nil in `quirks_mode`.
249
+ * Make JSON.dump and JSON.load methods better cooperate with Rails' serialize
250
+ method. Just use:
251
+ serialize :value, JSON
252
+ * Fix bug with time serialization concerning nanoseconds. Thanks for the
253
+ patch go to Josh Partlow (jpartlow@github).
254
+ * Improve parsing speed for JSON numbers (integers and floats) in a similar way to
255
+ what Evan Phoenix <evan@phx.io> suggested in:
256
+ https://github.com/flori/json/pull/103
257
+
258
+ ## 2011-09-18 (1.6.1)
259
+ * Using -target 1.5 to force Java bits to compile with 1.5.
260
+
261
+ ## 2011-09-12 (1.6.0)
262
+ * Extract utilities (prettifier and GUI-editor) in its own gem json-utils.
263
+ * Split json/add/core into different files for classes to be serialised.
264
+
265
+ ## 2011-08-31 (1.5.4)
266
+ * Fix memory leak when used from multiple JRuby. (Patch by
267
+ jfirebaugh@github).
268
+ * Apply patch by Eric Wong <nocode@yhbt.net> that fixes garbage collection problem
269
+ reported in https://github.com/flori/json/issues/46.
270
+ * Add :quirks_mode option to parser and generator.
271
+ * Add support for Rational and Complex number additions via json/add/complex
272
+ and json/add/rational requires.
273
+
274
+ ## 2011-06-20 (1.5.3)
275
+ * Alias State#configure method as State#merge to increase duck type synonymy with Hash.
276
+ * Add `as_json` methods in json/add/core, so rails can create its json objects
277
+ the new way.
278
+
279
+ ## 2011-05-11 (1.5.2)
280
+ * Apply documentation patch by Cory Monty <cory.monty@gmail.com>.
281
+ * Add gemspecs for json and json\_pure.
282
+ * Fix bug in jruby pretty printing.
283
+ * Fix bug in `object_class` and `array_class` when inheriting from Hash or
284
+ Array.
285
+
286
+ ## 2011-01-24 (1.5.1)
287
+ * Made rake-compiler build a fat binary gem. This should fix issue
288
+ https://github.com/flori/json/issues#issue/54.
289
+
290
+ ## 2011-01-22 (1.5.0)
291
+ * Included Java source codes for the Jruby extension made by Daniel Luz
292
+ <dev@mernen.com>.
293
+ * Output full exception message of `deep_const_get` to aid debugging.
294
+ * Fixed an issue with ruby 1.9 `Module#const_defined?` method, that was
295
+ reported by Riley Goodside.
296
+
297
+ ## 2010-08-09 (1.4.6)
298
+ * Fixed oversight reported in http://github.com/flori/json/issues/closed#issue/23,
299
+ always create a new object from the state prototype.
300
+ * Made pure and ext api more similar again.
301
+
302
+ ## 2010-08-07 (1.4.5)
303
+ * Manage data structure nesting depth in state object during generation. This
304
+ should reduce problems with `to_json` method definіtions that only have one
305
+ argument.
306
+ * Some fixes in the state objects and additional tests.
307
+ ## 2010-08-06 (1.4.4)
308
+ * Fixes build problem for rubinius under OS X, http://github.com/flori/json/issues/closed#issue/25
309
+ * Fixes crashes described in http://github.com/flori/json/issues/closed#issue/21 and
310
+ http://github.com/flori/json/issues/closed#issue/23
311
+ ## 2010-05-05 (1.4.3)
312
+ * Fixed some test assertions, from Ruby r27587 and r27590, patch by nobu.
313
+ * Fixed issue http://github.com/flori/json/issues/#issue/20 reported by
314
+ electronicwhisper@github. Thx!
315
+
316
+ ## 2010-04-26 (1.4.2)
317
+ * Applied patch from naruse Yui NARUSE <naruse@airemix.com> to make building with
318
+ Microsoft Visual C possible again.
319
+ * Applied patch from devrandom <c1.github@niftybox.net> in order to allow building of
320
+ json_pure if extensiontask is not present.
321
+ * Thanks to Dustin Schneider <dustin@stocktwits.com>, who reported a memory
322
+ leak, which is fixed in this release.
323
+ * Applied 993f261ccb8f911d2ae57e9db48ec7acd0187283 patch from josh@github.
324
+
325
+ ## 2010-04-25 (1.4.1)
326
+ * Fix for a bug reported by Dan DeLeo <dan@kallistec.com>, caused by T_FIXNUM
327
+ being different on 32bit/64bit architectures.
328
+
329
+ ## 2010-04-23 (1.4.0)
330
+ * Major speed improvements and building with simplified
331
+ directory/file-structure.
332
+ * Extension should at least be compatible with MRI, YARV and Rubinius.
333
+
334
+ ## 2010-04-07 (1.2.4)
335
+ * Triger const_missing callback to make Rails' dynamic class loading work.
336
+
337
+ ## 2010-03-11 (1.2.3)
338
+ * Added a `State#[]` method which returns an attribute's value in order to
339
+ increase duck type compatibility to Hash.
340
+
341
+ ## 2010-02-27 (1.2.2)
342
+ * Made some changes to make the building of the parser/generator compatible
343
+ to Rubinius.
344
+
345
+ ## 2009-11-25 (1.2.1)
346
+ * Added `:symbolize_names` option to Parser, which returns symbols instead of
347
+ strings in object names/keys.
348
+
349
+ ## 2009-10-01 (1.2.0)
350
+ * `fast_generate` now raises an exception for nan and infinite floats.
351
+ * On Ruby 1.8 json supports parsing of UTF-8, UTF-16BE, UTF-16LE, UTF-32BE,
352
+ and UTF-32LE JSON documents now. Under Ruby 1.9 the M17n conversion
353
+ functions are used to convert from all supported encodings. ASCII-8BIT
354
+ encoded strings are handled like all strings under Ruby 1.8 were.
355
+ * Better documentation
356
+
357
+ ## 2009-08-23 (1.1.9)
358
+ * Added forgotten main doc file `extra_rdoc_files`.
359
+
360
+ ## 2009-08-23 (1.1.8)
361
+ * Applied a patch by OZAWA Sakuro <sakuro@2238club.org> to make json/pure
362
+ work in environments that don't provide iconv.
363
+ * Applied patch by okkez_ in order to fix Ruby Bug #1768:
364
+ http://redmine.ruby-lang.org/issues/show/1768.
365
+ * Finally got around to avoid the rather paranoid escaping of ?/ characters
366
+ in the generator's output. The parsers aren't affected by this change.
367
+ Thanks to Rich Apodaca <rapodaca@metamolecular.com> for the suggestion.
368
+
369
+ ## 2009-06-29 (1.1.7)
370
+ * Security Fix for JSON::Pure::Parser. A specially designed string could
371
+ cause catastrophic backtracking in one of the parser's regular expressions
372
+ in earlier 1.1.x versions. JSON::Ext::Parser isn't affected by this issue.
373
+ Thanks to Bartosz Blimke <bartosz@new-bamboo.co.uk> for reporting this
374
+ problem.
375
+ * This release also uses a less strict ruby version requirement for the
376
+ creation of the mswin32 native gem.
377
+
378
+ ## 2009-05-10 (1.1.6)
379
+ * No changes. І tested native linux gems in the last release and they don't
380
+ play well with different ruby versions other than the one the gem was built
381
+ with. This release is just to bump the version number in order to skip the
382
+ native gem on rubyforge.
383
+
384
+ ## 2009-05-10 (1.1.5)
385
+ * Started to build gems with rake-compiler gem.
386
+ * Applied patch object/array class patch from Brian Candler
387
+ <B.Candler@pobox.com> and fixes.
388
+
389
+ ## 2009-04-01 (1.1.4)
390
+ * Fixed a bug in the creation of serialized generic rails objects reported by
391
+ Friedrich Graeter <graeter@hydrixos.org>.
392
+ * Deleted tests/runner.rb, we're using testrb instead.
393
+ * Editor supports Infinity in numbers now.
394
+ * Made some changes in order to get the library to compile/run under Ruby
395
+ 1.9.
396
+ * Improved speed of the code path for the fast_generate method in the pure
397
+ variant.
398
+
399
+ ## 2008-07-10 (1.1.3)
400
+ * Wesley Beary <monki@geemus.com> reported a bug in json/add/core's DateTime
401
+ handling: If the nominator and denominator of the offset were divisible by
402
+ each other Ruby's Rational#to_s returns them as an integer not a fraction
403
+ with '/'. This caused a ZeroDivisionError during parsing.
404
+ * Use Date#start and DateTime#start instead of sg method, while
405
+ remaining backwards compatible.
406
+ * Supports ragel >= 6.0 now.
407
+ * Corrected some tests.
408
+ * Some minor changes.
409
+
410
+ ## 2007-11-27 (1.1.2)
411
+ * Remember default dir (last used directory) in editor.
412
+ * JSON::Editor.edit method added, the editor can now receive json texts from
413
+ the clipboard via C-v.
414
+ * Load json texts from an URL pasted via middle button press.
415
+ * Added :create_additions option to Parser. This makes it possible to disable
416
+ the creation of additions by force, in order to treat json texts as data
417
+ while having additions loaded.
418
+ * Jacob Maine <jmaine@blurb.com> reported, that JSON(:foo) outputs a JSON
419
+ object if the rails addition is enabled, which is wrong. It now outputs a
420
+ JSON string "foo" instead, like suggested by Jacob Maine.
421
+ * Discovered a bug in the Ruby Bugs Tracker on rubyforge, that was reported
422
+ by John Evans lgastako@gmail.com. He could produce a crash in the JSON
423
+ generator by returning something other than a String instance from a
424
+ to_json method. I now guard against this by doing a rather crude type
425
+ check, which raises an exception instead of crashing.
426
+
427
+ ## 2007-07-06 (1.1.1)
428
+ * Yui NARUSE <naruse@airemix.com> sent some patches to fix tests for Ruby
429
+ 1.9. I applied them and adapted some of them a bit to run both on 1.8 and
430
+ 1.9.
431
+ * Introduced a `JSON.parse!` method without depth checking for people who
432
+ like danger.
433
+ * Made generate and `pretty_generate` methods configurable by an options hash.
434
+ * Added :allow_nan option to parser and generator in order to handle NaN,
435
+ Infinity, and -Infinity correctly - if requested. Floats, which aren't numbers,
436
+ aren't valid JSON according to RFC4627, so by default an exception will be
437
+ raised if any of these symbols are encountered. Thanks to Andrea Censi
438
+ <andrea.censi@dis.uniroma1.it> for his hint about this.
439
+ * Fixed some more tests for Ruby 1.9.
440
+ * Implemented dump/load interface of Marshal as suggested in ruby-core:11405
441
+ by murphy <murphy@rubychan.de>.
442
+ * Implemented the `max_nesting` feature for generate methods, too.
443
+ * Added some implementations for ruby core's custom objects for
444
+ serialisation/deserialisation purposes.
445
+
446
+ ## 2007-05-21 (1.1.0)
447
+ * Implemented max_nesting feature for parser to avoid stack overflows for
448
+ data from untrusted sources. If you trust the source, you can disable it
449
+ with the option max_nesting => false.
450
+ * Piers Cawley <pdcawley@bofh.org.uk> reported a bug, that not every
451
+ character can be escaped by `\` as required by RFC4627. There's a
452
+ contradiction between David Crockford's JSON checker test vectors (in
453
+ tests/fixtures) and RFC4627, though. I decided to stick to the RFC, because
454
+ the JSON checker seems to be a bit older than the RFC.
455
+ * Extended license to Ruby License, which includes the GPL.
456
+ * Added keyboard shortcuts, and 'Open location' menu item to edit_json.rb.
457
+
458
+ ## 2007-05-09 (1.0.4)
459
+ * Applied a patch from Yui NARUSE <naruse@airemix.com> to make JSON compile
460
+ under Ruby 1.9. Thank you very much for mailing it to me!
461
+ * Made binary variants of JSON fail early, instead of falling back to the
462
+ pure version. This should avoid overshadowing of eventual problems while
463
+ loading of the binary.
464
+
465
+ ## 2007-03-24 (1.0.3)
466
+ * Improved performance of pure variant a bit.
467
+ * The ext variant of this release supports the mswin32 platform. Ugh!
468
+
469
+ ## 2007-03-24 (1.0.2)
470
+ * Ext Parser didn't parse 0e0 correctly into 0.0: Fixed!
471
+
472
+ ## 2007-03-24 (1.0.1)
473
+ * Forgot some object files in the build dir. I really like that - not!
474
+
475
+ ## 2007-03-24 (1.0.0)
476
+ * Added C implementations for the JSON generator and a ragel based JSON
477
+ parser in C.
478
+ * Much more tests, especially fixtures from json.org.
479
+ * Further improved conformance to RFC4627.
480
+
481
+ ## 2007-02-09 (0.4.3)
482
+ * Conform more to RFC4627 for JSON: This means JSON strings
483
+ now always must contain exactly one object `"{ ... }"` or array `"[ ... ]"` in
484
+ order to be parsed without raising an exception. The definition of what
485
+ constitutes a whitespace is narrower in JSON than in Ruby ([ \t\r\n]), and
486
+ there are differences in floats and integers (no octals or hexadecimals) as
487
+ well.
488
+ * Added aliases generate and `pretty_generate` of unparse and `pretty_unparse`.
489
+ * Fixed a test case.
490
+ * Catch an `Iconv::InvalidEncoding` exception, that seems to occur on some Sun
491
+ boxes with SunOS 5.8, if iconv doesn't support utf16 conversions. This was
492
+ reported by Andrew R Jackson <andrewj@bcm.tmc.edu>, thanks a bunch!
493
+
494
+ ## 2006-08-25 (0.4.2)
495
+ * Fixed a bug in handling solidi (/-characters), that was reported by
496
+ Kevin Gilpin <kevin.gilpin@alum.mit.edu>.
497
+
498
+ ## 2006-02-06 (0.4.1)
499
+ * Fixed a bug related to escaping with backslashes. Thanks for the report go
500
+ to Florian Munz <surf@theflow.de>.
501
+
502
+ ## 2005-09-23 (0.4.0)
503
+ * Initial Rubyforge Version
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.