json 1.8.2 → 2.3.1

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