json 1.8.3 → 2.4.0

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