json 2.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of json might be problematic. Click here for more details.

Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.travis.yml +23 -0
  4. data/CHANGES.md +391 -0
  5. data/Gemfile +14 -0
  6. data/README-json-jruby.md +33 -0
  7. data/README.md +409 -0
  8. data/Rakefile +408 -0
  9. data/VERSION +1 -0
  10. data/diagrams/.keep +0 -0
  11. data/ext/json/ext/fbuffer/fbuffer.h +187 -0
  12. data/ext/json/ext/generator/depend +1 -0
  13. data/ext/json/ext/generator/extconf.rb +4 -0
  14. data/ext/json/ext/generator/generator.c +1444 -0
  15. data/ext/json/ext/generator/generator.h +171 -0
  16. data/ext/json/ext/parser/depend +1 -0
  17. data/ext/json/ext/parser/extconf.rb +6 -0
  18. data/ext/json/ext/parser/parser.c +2131 -0
  19. data/ext/json/ext/parser/parser.h +91 -0
  20. data/ext/json/ext/parser/parser.rl +891 -0
  21. data/ext/json/extconf.rb +2 -0
  22. data/install.rb +23 -0
  23. data/java/src/json/ext/ByteListTranscoder.java +166 -0
  24. data/java/src/json/ext/Generator.java +443 -0
  25. data/java/src/json/ext/GeneratorMethods.java +231 -0
  26. data/java/src/json/ext/GeneratorService.java +42 -0
  27. data/java/src/json/ext/GeneratorState.java +490 -0
  28. data/java/src/json/ext/OptionsReader.java +113 -0
  29. data/java/src/json/ext/Parser.java +2362 -0
  30. data/java/src/json/ext/Parser.rl +893 -0
  31. data/java/src/json/ext/ParserService.java +34 -0
  32. data/java/src/json/ext/RuntimeInfo.java +116 -0
  33. data/java/src/json/ext/StringDecoder.java +166 -0
  34. data/java/src/json/ext/StringEncoder.java +111 -0
  35. data/java/src/json/ext/Utils.java +88 -0
  36. data/json-java.gemspec +38 -0
  37. data/json.gemspec +0 -0
  38. data/json_pure.gemspec +38 -0
  39. data/lib/json.rb +63 -0
  40. data/lib/json/add/bigdecimal.rb +29 -0
  41. data/lib/json/add/complex.rb +29 -0
  42. data/lib/json/add/core.rb +12 -0
  43. data/lib/json/add/date.rb +34 -0
  44. data/lib/json/add/date_time.rb +50 -0
  45. data/lib/json/add/exception.rb +31 -0
  46. data/lib/json/add/ostruct.rb +31 -0
  47. data/lib/json/add/range.rb +29 -0
  48. data/lib/json/add/rational.rb +28 -0
  49. data/lib/json/add/regexp.rb +30 -0
  50. data/lib/json/add/set.rb +29 -0
  51. data/lib/json/add/struct.rb +30 -0
  52. data/lib/json/add/symbol.rb +25 -0
  53. data/lib/json/add/time.rb +38 -0
  54. data/lib/json/common.rb +456 -0
  55. data/lib/json/ext.rb +15 -0
  56. data/lib/json/ext/.keep +0 -0
  57. data/lib/json/generic_object.rb +71 -0
  58. data/lib/json/pure.rb +15 -0
  59. data/lib/json/pure/generator.rb +458 -0
  60. data/lib/json/pure/parser.rb +311 -0
  61. data/lib/json/version.rb +9 -0
  62. data/references/rfc7159.txt +899 -0
  63. data/tests/fixtures/fail10.json +1 -0
  64. data/tests/fixtures/fail11.json +1 -0
  65. data/tests/fixtures/fail12.json +1 -0
  66. data/tests/fixtures/fail13.json +1 -0
  67. data/tests/fixtures/fail14.json +1 -0
  68. data/tests/fixtures/fail18.json +1 -0
  69. data/tests/fixtures/fail19.json +1 -0
  70. data/tests/fixtures/fail2.json +1 -0
  71. data/tests/fixtures/fail20.json +1 -0
  72. data/tests/fixtures/fail21.json +1 -0
  73. data/tests/fixtures/fail22.json +1 -0
  74. data/tests/fixtures/fail23.json +1 -0
  75. data/tests/fixtures/fail24.json +1 -0
  76. data/tests/fixtures/fail25.json +1 -0
  77. data/tests/fixtures/fail27.json +2 -0
  78. data/tests/fixtures/fail28.json +2 -0
  79. data/tests/fixtures/fail3.json +1 -0
  80. data/tests/fixtures/fail4.json +1 -0
  81. data/tests/fixtures/fail5.json +1 -0
  82. data/tests/fixtures/fail6.json +1 -0
  83. data/tests/fixtures/fail7.json +1 -0
  84. data/tests/fixtures/fail8.json +1 -0
  85. data/tests/fixtures/fail9.json +1 -0
  86. data/tests/fixtures/obsolete_fail1.json +1 -0
  87. data/tests/fixtures/pass1.json +56 -0
  88. data/tests/fixtures/pass15.json +1 -0
  89. data/tests/fixtures/pass16.json +1 -0
  90. data/tests/fixtures/pass17.json +1 -0
  91. data/tests/fixtures/pass2.json +1 -0
  92. data/tests/fixtures/pass26.json +1 -0
  93. data/tests/fixtures/pass3.json +6 -0
  94. data/tests/json_addition_test.rb +203 -0
  95. data/tests/json_common_interface_test.rb +126 -0
  96. data/tests/json_encoding_test.rb +107 -0
  97. data/tests/json_ext_parser_test.rb +15 -0
  98. data/tests/json_fixtures_test.rb +32 -0
  99. data/tests/json_generator_test.rb +377 -0
  100. data/tests/json_generic_object_test.rb +82 -0
  101. data/tests/json_parser_test.rb +472 -0
  102. data/tests/json_string_matching_test.rb +38 -0
  103. data/tests/test_helper.rb +17 -0
  104. data/tools/diff.sh +18 -0
  105. data/tools/fuzz.rb +131 -0
  106. data/tools/server.rb +62 -0
  107. metadata +185 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0d5aa01bc44bdf00e8465d5acbde009357987e98ac653672feba63b81f98dfc8
4
+ data.tar.gz: 5845322c2daa41d815c4b845c6561d2addf86b459a5c093590317210d6d85901
5
+ SHA512:
6
+ metadata.gz: f553341d9b8c4d20788255a35a48816a59cacb408f183e8a6009ab9326b66d80078961d4cc9da8e62155e4bb00f31dedddb449cf30afdb386ab6b49e248299dd
7
+ data.tar.gz: e74601af87a7ec32952fd596b4981b0d26c4f96ddb88979a26b2fb06604dff204d38ba7c120cd0389756edb83cbd81b6fc569d16f5f7740b8b2915d63cdc8f22
@@ -0,0 +1,17 @@
1
+ .*.sw[pon]
2
+ *.bundle
3
+ coverage
4
+ tags
5
+ pkg
6
+ .nfs.*
7
+ .idea
8
+ java/Json.iml
9
+ Gemfile.lock
10
+ .rvmrc
11
+ *.rbc
12
+ .rbx
13
+ .AppleDouble
14
+ .DS_Store
15
+ */**/Makefile
16
+ */**/*.o
17
+ .byebug_history
@@ -0,0 +1,23 @@
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
12
+ - 2.4
13
+ - 2.5
14
+ - 2.6
15
+ - ruby-head
16
+ - jruby
17
+ matrix:
18
+ allow_failures:
19
+ - rvm: 1.9.3
20
+ - rvm: ruby-head
21
+ - rvm: jruby
22
+ script: "bundle exec rake"
23
+ sudo: false
@@ -0,0 +1,391 @@
1
+ # Changes
2
+
3
+ ## 2019-02-21 (2.2.0)
4
+ * Adds support for 2.6 BigDecimal and ruby standard library Set datetype.
5
+
6
+ ## 2017-04-18 (2.1.0)
7
+ * Allow passing of `decimal_class` option to specify a class as which to parse
8
+ JSON float numbers.
9
+ ## 2017-03-23 (2.0.4)
10
+ * Raise exception for incomplete unicode surrogates/character escape
11
+ sequences. This problem was reported by Daniel Gollahon (dgollahon).
12
+ * Fix arbitrary heap exposure problem. This problem was reported by Ahmad
13
+ Sherif (ahmadsherif).
14
+
15
+ ## 2017-01-12 (2.0.3)
16
+ * Set `required_ruby_version` to 1.9
17
+ * Some small fixes
18
+
19
+ ## 2016-07-26 (2.0.2)
20
+ * Specify `required_ruby_version` for json\_pure.
21
+ * Fix issue #295 failure when parsing frozen strings.
22
+
23
+ ## 2016-07-01 (2.0.1)
24
+ * Fix problem when requiring json\_pure and Parser constant was defined top
25
+ level.
26
+ * Add `RB_GC_GUARD` to avoid possible GC problem via Pete Johns.
27
+ * Store `current_nesting` on stack by Aaron Patterson.
28
+
29
+ ## 2015-09-11 (2.0.0)
30
+ * Now complies to newest JSON RFC 7159.
31
+ * Implements compatibiliy to ruby 2.4 integer unification.
32
+ * Drops support for old rubies whose life has ended, that is rubies < 2.0.
33
+ Also see https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/
34
+ * There were still some mentions of dual GPL licensing in the source, but JSON
35
+ has just the Ruby license that itself includes an explicit dual-licensing
36
+ clause that allows covered software to be distributed under the terms of
37
+ the Simplified BSD License instead for all ruby versions >= 1.9.3. This is
38
+ however a GPL compatible license according to the Free Software Foundation.
39
+ I changed these mentions to be consistent with the Ruby license setting in
40
+ the gemspec files which were already correct now.
41
+
42
+ ## 2015-06-01 (1.8.3)
43
+ * Fix potential memory leak, thx to nobu.
44
+
45
+ ## 2015-01-08 (1.8.2)
46
+ * Some performance improvements by Vipul A M <vipulnsward@gmail.com>.
47
+ * Fix by Jason R. Clark <jclark@newrelic.com> to avoid mutation of
48
+ `JSON.dump_default_options`.
49
+ * More tests by Michael Mac-Vicar <mmacvicar@gmail.com> and fixing
50
+ `space_before` accessor in generator.
51
+ * Performance on Jruby improved by Ben Browning <bbrownin@redhat.com>.
52
+ * Some fixes to be compatible with the new Ruby 2.2 by Zachary Scott <e@zzak.io>
53
+ and SHIBATA Hiroshi <hsbt@ruby-lang.org>.
54
+
55
+ ## 2013-05-13 (1.8.1)
56
+ * Remove Rubinius exception since transcoding should be working now.
57
+
58
+ ## 2013-05-13 (1.8.0)
59
+ * Fix https://github.com/flori/json/issues/162 reported by Marc-Andre
60
+ Lafortune <github_rocks@marc-andre.ca>. Thanks!
61
+ * Applied patches by Yui NARUSE <naruse@airemix.jp> to suppress warning with
62
+ -Wchar-subscripts and better validate UTF-8 strings.
63
+ * Applied patch by ginriki@github to remove unnecessary if.
64
+ * Add load/dump interface to `JSON::GenericObject` to make
65
+ serialize :some_attribute, `JSON::GenericObject`
66
+ work in Rails active models for convenient `SomeModel#some_attribute.foo.bar`
67
+ access to serialised JSON data.
68
+
69
+ ## 2013-02-04 (1.7.7)
70
+ * Security fix for JSON create_additions default value and
71
+ `JSON::GenericObject`. It should not be possible to create additions unless
72
+ explicitely requested by setting the create_additions argument to true or
73
+ using the JSON.load/dump interface. If `JSON::GenericObject` is supposed to
74
+ be automatically deserialised, this has to be explicitely enabled by
75
+ setting
76
+ JSON::GenericObject.json_creatable = true
77
+ as well.
78
+ * Remove useless assert in fbuffer implementation.
79
+ * Apply patch attached to https://github.com/flori/json/issues#issue/155
80
+ provided by John Shahid <jvshahid@gmail.com>, Thx!
81
+ * Add license information to rubygems spec data, reported by Jordi Massaguer Pla <jmassaguerpla@suse.de>.
82
+ * Improve documentation, thx to Zachary Scott <zachary@zacharyscott.net>.
83
+
84
+ ## 2012-11-29 (1.7.6)
85
+ * Add `GeneratorState#merge` alias for JRuby, fix state accessor methods. Thx to
86
+ jvshahid@github.
87
+ * Increase hash likeness of state objects.
88
+
89
+ ## 2012-08-17 (1.7.5)
90
+ * Fix compilation of extension on older rubies.
91
+
92
+ ## 2012-07-26 (1.7.4)
93
+ * Fix compilation problem on AIX, see https://github.com/flori/json/issues/142
94
+
95
+ ## 2012-05-12 (1.7.3)
96
+ * Work around Rubinius encoding issues using iconv for conversion instead.
97
+
98
+ ## 2012-05-11 (1.7.2)
99
+ * Fix some encoding issues, that cause problems for the pure and the
100
+ extension variant in jruby 1.9 mode.
101
+
102
+ ## 2012-04-28 (1.7.1)
103
+ * Some small fixes for building
104
+
105
+ ## 2012-04-28 (1.7.0)
106
+ * Add `JSON::GenericObject` for method access to objects transmitted via JSON.
107
+
108
+ ## 2012-04-27 (1.6.7)
109
+ * Fix possible crash when trying to parse nil value.
110
+
111
+ ## 2012-02-11 (1.6.6)
112
+ * Propagate src encoding to values made from it (fixes 1.9 mode converting
113
+ everything to ascii-8bit; harmless for 1.8 mode too) (Thomas E. Enebo
114
+ <tom.enebo@gmail.com>), should fix
115
+ https://github.com/flori/json/issues#issue/119.
116
+ * Fix https://github.com/flori/json/issues#issue/124 Thx to Jason Hutchens.
117
+ * Fix https://github.com/flori/json/issues#issue/117
118
+
119
+ ## 2012-01-15 (1.6.5)
120
+ * Vit Ondruch <v.ondruch@tiscali.cz> reported a bug that shows up when using
121
+ optimisation under GCC 4.7. Thx to him, Bohuslav Kabrda
122
+ <bkabrda@redhat.com> and Yui NARUSE <naruse@airemix.jp> for debugging and
123
+ developing a patch fix.
124
+
125
+ ## 2011-12-24 (1.6.4)
126
+ * Patches that improve speed on JRuby contributed by Charles Oliver Nutter
127
+ <headius@headius.com>.
128
+ * Support `object_class`/`array_class` with duck typed hash/array.
129
+
130
+ ## 2011-12-01 (1.6.3)
131
+ * Let `JSON.load('')` return nil as well to make mysql text columns (default to
132
+ `''`) work better for serialization.
133
+
134
+ ## 2011-11-21 (1.6.2)
135
+ * Add support for OpenStruct and BigDecimal.
136
+ * Fix bug when parsing nil in `quirks_mode`.
137
+ * Make JSON.dump and JSON.load methods better cooperate with Rails' serialize
138
+ method. Just use:
139
+ serialize :value, JSON
140
+ * Fix bug with time serialization concerning nanoseconds. Thanks for the
141
+ patch go to Josh Partlow (jpartlow@github).
142
+ * Improve parsing speed for JSON numbers (integers and floats) in a similar way to
143
+ what Evan Phoenix <evan@phx.io> suggested in:
144
+ https://github.com/flori/json/pull/103
145
+
146
+ ## 2011-09-18 (1.6.1)
147
+ * Using -target 1.5 to force Java bits to compile with 1.5.
148
+
149
+ ## 2011-09-12 (1.6.0)
150
+ * Extract utilities (prettifier and GUI-editor) in its own gem json-utils.
151
+ * Split json/add/core into different files for classes to be serialised.
152
+
153
+ ## 2011-08-31 (1.5.4)
154
+ * Fix memory leak when used from multiple JRuby. (Patch by
155
+ jfirebaugh@github).
156
+ * Apply patch by Eric Wong <nocode@yhbt.net> that fixes garbage collection problem
157
+ reported in https://github.com/flori/json/issues/46.
158
+ * Add :quirks_mode option to parser and generator.
159
+ * Add support for Rational and Complex number additions via json/add/complex
160
+ and json/add/rational requires.
161
+
162
+ ## 2011-06-20 (1.5.3)
163
+ * Alias State#configure method as State#merge to increase duck type synonymy with Hash.
164
+ * Add `as_json` methods in json/add/core, so rails can create its json objects
165
+ the new way.
166
+
167
+ ## 2011-05-11 (1.5.2)
168
+ * Apply documentation patch by Cory Monty <cory.monty@gmail.com>.
169
+ * Add gemspecs for json and json\_pure.
170
+ * Fix bug in jruby pretty printing.
171
+ * Fix bug in `object_class` and `array_class` when inheriting from Hash or
172
+ Array.
173
+
174
+ ## 2011-01-24 (1.5.1)
175
+ * Made rake-compiler build a fat binary gem. This should fix issue
176
+ https://github.com/flori/json/issues#issue/54.
177
+
178
+ ## 2011-01-22 (1.5.0)
179
+ * Included Java source codes for the Jruby extension made by Daniel Luz
180
+ <dev@mernen.com>.
181
+ * Output full exception message of `deep_const_get` to aid debugging.
182
+ * Fixed an issue with ruby 1.9 `Module#const_defined?` method, that was
183
+ reported by Riley Goodside.
184
+
185
+ ## 2010-08-09 (1.4.6)
186
+ * Fixed oversight reported in http://github.com/flori/json/issues/closed#issue/23,
187
+ always create a new object from the state prototype.
188
+ * Made pure and ext api more similar again.
189
+
190
+ ## 2010-08-07 (1.4.5)
191
+ * Manage data structure nesting depth in state object during generation. This
192
+ should reduce problems with `to_json` method definіtions that only have one
193
+ argument.
194
+ * Some fixes in the state objects and additional tests.
195
+ ## 2010-08-06 (1.4.4)
196
+ * Fixes build problem for rubinius under OS X, http://github.com/flori/json/issues/closed#issue/25
197
+ * Fixes crashes described in http://github.com/flori/json/issues/closed#issue/21 and
198
+ http://github.com/flori/json/issues/closed#issue/23
199
+ ## 2010-05-05 (1.4.3)
200
+ * Fixed some test assertions, from Ruby r27587 and r27590, patch by nobu.
201
+ * Fixed issue http://github.com/flori/json/issues/#issue/20 reported by
202
+ electronicwhisper@github. Thx!
203
+
204
+ ## 2010-04-26 (1.4.2)
205
+ * Applied patch from naruse Yui NARUSE <naruse@airemix.com> to make building with
206
+ Microsoft Visual C possible again.
207
+ * Applied patch from devrandom <c1.github@niftybox.net> in order to allow building of
208
+ json_pure if extensiontask is not present.
209
+ * Thanks to Dustin Schneider <dustin@stocktwits.com>, who reported a memory
210
+ leak, which is fixed in this release.
211
+ * Applied 993f261ccb8f911d2ae57e9db48ec7acd0187283 patch from josh@github.
212
+
213
+ ## 2010-04-25 (1.4.1)
214
+ * Fix for a bug reported by Dan DeLeo <dan@kallistec.com>, caused by T_FIXNUM
215
+ being different on 32bit/64bit architectures.
216
+
217
+ ## 2010-04-23 (1.4.0)
218
+ * Major speed improvements and building with simplified
219
+ directory/file-structure.
220
+ * Extension should at least be comapatible with MRI, YARV and Rubinius.
221
+
222
+ ## 2010-04-07 (1.2.4)
223
+ * Triger const_missing callback to make Rails' dynamic class loading work.
224
+
225
+ ## 2010-03-11 (1.2.3)
226
+ * Added a `State#[]` method which returns an attribute's value in order to
227
+ increase duck type compatibility to Hash.
228
+
229
+ ## 2010-02-27 (1.2.2)
230
+ * Made some changes to make the building of the parser/generator compatible
231
+ to Rubinius.
232
+
233
+ ## 2009-11-25 (1.2.1)
234
+ * Added `:symbolize_names` option to Parser, which returns symbols instead of
235
+ strings in object names/keys.
236
+
237
+ ## 2009-10-01 (1.2.0)
238
+ * `fast_generate` now raises an exeception for nan and infinite floats.
239
+ * On Ruby 1.8 json supports parsing of UTF-8, UTF-16BE, UTF-16LE, UTF-32BE,
240
+ and UTF-32LE JSON documents now. Under Ruby 1.9 the M17n conversion
241
+ functions are used to convert from all supported encodings. ASCII-8BIT
242
+ encoded strings are handled like all strings under Ruby 1.8 were.
243
+ * Better documentation
244
+
245
+ ## 2009-08-23 (1.1.9)
246
+ * Added forgotten main doc file `extra_rdoc_files`.
247
+
248
+ ## 2009-08-23 (1.1.8)
249
+ * Applied a patch by OZAWA Sakuro <sakuro@2238club.org> to make json/pure
250
+ work in environments that don't provide iconv.
251
+ * Applied patch by okkez_ in order to fix Ruby Bug #1768:
252
+ http://redmine.ruby-lang.org/issues/show/1768.
253
+ * Finally got around to avoid the rather paranoid escaping of ?/ characters
254
+ in the generator's output. The parsers aren't affected by this change.
255
+ Thanks to Rich Apodaca <rapodaca@metamolecular.com> for the suggestion.
256
+
257
+ ## 2009-06-29 (1.1.7)
258
+ * Security Fix for JSON::Pure::Parser. A specially designed string could
259
+ cause catastrophic backtracking in one of the parser's regular expressions
260
+ in earlier 1.1.x versions. JSON::Ext::Parser isn't affected by this issue.
261
+ Thanks to Bartosz Blimke <bartosz@new-bamboo.co.uk> for reporting this
262
+ problem.
263
+ * This release also uses a less strict ruby version requirement for the
264
+ creation of the mswin32 native gem.
265
+
266
+ ## 2009-05-10 (1.1.6)
267
+ * No changes. І tested native linux gems in the last release and they don't
268
+ play well with different ruby versions other than the one the gem was built
269
+ with. This release is just to bump the version number in order to skip the
270
+ native gem on rubyforge.
271
+
272
+ ## 2009-05-10 (1.1.5)
273
+ * Started to build gems with rake-compiler gem.
274
+ * Applied patch object/array class patch from Brian Candler
275
+ <B.Candler@pobox.com> and fixes.
276
+
277
+ ## 2009-04-01 (1.1.4)
278
+ * Fixed a bug in the creation of serialized generic rails objects reported by
279
+ Friedrich Graeter <graeter@hydrixos.org>.
280
+ * Deleted tests/runner.rb, we're using testrb instead.
281
+ * Editor supports Infinity in numbers now.
282
+ * Made some changes in order to get the library to compile/run under Ruby
283
+ 1.9.
284
+ * Improved speed of the code path for the fast_generate method in the pure
285
+ variant.
286
+
287
+ ## 2008-07-10 (1.1.3)
288
+ * Wesley Beary <monki@geemus.com> reported a bug in json/add/core's DateTime
289
+ handling: If the nominator and denominator of the offset were divisible by
290
+ each other Ruby's Rational#to_s returns them as an integer not a fraction
291
+ with '/'. This caused a ZeroDivisionError during parsing.
292
+ * Use Date#start and DateTime#start instead of sg method, while
293
+ remaining backwards compatible.
294
+ * Supports ragel >= 6.0 now.
295
+ * Corrected some tests.
296
+ * Some minor changes.
297
+
298
+ ## 2007-11-27 (1.1.2)
299
+ * Remember default dir (last used directory) in editor.
300
+ * JSON::Editor.edit method added, the editor can now receive json texts from
301
+ the clipboard via C-v.
302
+ * Load json texts from an URL pasted via middle button press.
303
+ * Added :create_additions option to Parser. This makes it possible to disable
304
+ the creation of additions by force, in order to treat json texts as data
305
+ while having additions loaded.
306
+ * Jacob Maine <jmaine@blurb.com> reported, that JSON(:foo) outputs a JSON
307
+ object if the rails addition is enabled, which is wrong. It now outputs a
308
+ JSON string "foo" instead, like suggested by Jacob Maine.
309
+ * Discovered a bug in the Ruby Bugs Tracker on rubyforge, that was reported
310
+ by John Evans lgastako@gmail.com. He could produce a crash in the JSON
311
+ generator by returning something other than a String instance from a
312
+ to_json method. I now guard against this by doing a rather crude type
313
+ check, which raises an exception instead of crashing.
314
+
315
+ ## 2007-07-06 (1.1.1)
316
+ * Yui NARUSE <naruse@airemix.com> sent some patches to fix tests for Ruby
317
+ 1.9. I applied them and adapted some of them a bit to run both on 1.8 and
318
+ 1.9.
319
+ * Introduced a `JSON.parse!` method without depth checking for people who
320
+ like danger.
321
+ * Made generate and `pretty_generate` methods configurable by an options hash.
322
+ * Added :allow_nan option to parser and generator in order to handle NaN,
323
+ Infinity, and -Infinity correctly - if requested. Floats, which aren't numbers,
324
+ aren't valid JSON according to RFC4627, so by default an exception will be
325
+ raised if any of these symbols are encountered. Thanks to Andrea Censi
326
+ <andrea.censi@dis.uniroma1.it> for his hint about this.
327
+ * Fixed some more tests for Ruby 1.9.
328
+ * Implemented dump/load interface of Marshal as suggested in ruby-core:11405
329
+ by murphy <murphy@rubychan.de>.
330
+ * Implemented the `max_nesting` feature for generate methods, too.
331
+ * Added some implementations for ruby core's custom objects for
332
+ serialisation/deserialisation purposes.
333
+
334
+ ## 2007-05-21 (1.1.0)
335
+ * Implemented max_nesting feature for parser to avoid stack overflows for
336
+ data from untrusted sources. If you trust the source, you can disable it
337
+ with the option max_nesting => false.
338
+ * Piers Cawley <pdcawley@bofh.org.uk> reported a bug, that not every
339
+ character can be escaped by `\` as required by RFC4627. There's a
340
+ contradiction between David Crockford's JSON checker test vectors (in
341
+ tests/fixtures) and RFC4627, though. I decided to stick to the RFC, because
342
+ the JSON checker seems to be a bit older than the RFC.
343
+ * Extended license to Ruby License, which includes the GPL.
344
+ * Added keyboard shortcuts, and 'Open location' menu item to edit_json.rb.
345
+
346
+ ## 2007-05-09 (1.0.4)
347
+ * Applied a patch from Yui NARUSE <naruse@airemix.com> to make JSON compile
348
+ under Ruby 1.9. Thank you very much for mailing it to me!
349
+ * Made binary variants of JSON fail early, instead of falling back to the
350
+ pure version. This should avoid overshadowing of eventual problems while
351
+ loading of the binary.
352
+
353
+ ## 2007-03-24 (1.0.3)
354
+ * Improved performance of pure variant a bit.
355
+ * The ext variant of this release supports the mswin32 platform. Ugh!
356
+
357
+ ## 2007-03-24 (1.0.2)
358
+ * Ext Parser didn't parse 0e0 correctly into 0.0: Fixed!
359
+
360
+ ## 2007-03-24 (1.0.1)
361
+ * Forgot some object files in the build dir. I really like that - not!
362
+
363
+ ## 2007-03-24 (1.0.0)
364
+ * Added C implementations for the JSON generator and a ragel based JSON
365
+ parser in C.
366
+ * Much more tests, especially fixtures from json.org.
367
+ * Further improved conformance to RFC4627.
368
+
369
+ ## 2007-02-09 (0.4.3)
370
+ * Conform more to RFC4627 for JSON: This means JSON strings
371
+ now always must contain exactly one object `"{ ... }"` or array `"[ ... ]"` in
372
+ order to be parsed without raising an exception. The definition of what
373
+ constitutes a whitespace is narrower in JSON than in Ruby ([ \t\r\n]), and
374
+ there are differences in floats and integers (no octals or hexadecimals) as
375
+ well.
376
+ * Added aliases generate and `pretty_generate` of unparse and `pretty_unparse`.
377
+ * Fixed a test case.
378
+ * Catch an `Iconv::InvalidEncoding` exception, that seems to occur on some Sun
379
+ boxes with SunOS 5.8, if iconv doesn't support utf16 conversions. This was
380
+ reported by Andrew R Jackson <andrewj@bcm.tmc.edu>, thanks a bunch!
381
+
382
+ ## 2006-08-25 (0.4.2)
383
+ * Fixed a bug in handling solidi (/-characters), that was reported by
384
+ Kevin Gilpin <kevin.gilpin@alum.mit.edu>.
385
+
386
+ ## 2006-02-06 (0.4.1)
387
+ * Fixed a bug related to escaping with backslashes. Thanks for the report go
388
+ to Florian Munz <surf@theflow.de>.
389
+
390
+ ## 2005-09-23 (0.4.0)
391
+ * Initial Rubyforge Version
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # vim: set ft=ruby:
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ case ENV['JSON']
6
+ when 'ext', nil
7
+ if ENV['RUBY_ENGINE'] == 'jruby'
8
+ gemspec :name => 'json-java'
9
+ else
10
+ gemspec :name => 'json'
11
+ end
12
+ when 'pure'
13
+ gemspec :name => 'json_pure'
14
+ end