json 1.6.5-java → 1.6.6-java

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.

Binary file
Binary file
@@ -255,8 +255,12 @@ module JSON
255
255
  # GeneratorError exception.
256
256
  def generate(obj)
257
257
  result = obj.to_json(self)
258
- if !@quirks_mode && result !~ /\A\s*(?:\[.*\]|\{.*\})\s*\Z/m
259
- raise GeneratorError, "only generation of JSON objects or arrays allowed"
258
+ unless @quirks_mode
259
+ unless result =~ /\A\s*\[/ && result =~ /\]\s*\Z/ ||
260
+ result =~ /\A\s*\{/ && result =~ /\}\s*\Z/
261
+ then
262
+ raise GeneratorError, "only generation of JSON objects or arrays allowed"
263
+ end
260
264
  end
261
265
  result
262
266
  end
@@ -1,6 +1,6 @@
1
1
  module JSON
2
2
  # JSON version
3
- VERSION = '1.6.5'
3
+ VERSION = '1.6.6'
4
4
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -314,7 +314,7 @@ class TC_JSON < Test::Unit::TestCase
314
314
  assert res.item_set?
315
315
  end
316
316
 
317
- def test_generation_of_core_subclasses_with_new_to_json
317
+ def test_generate_core_subclasses_with_new_to_json
318
318
  obj = SubHash2["foo" => SubHash2["bar" => true]]
319
319
  obj_json = JSON(obj)
320
320
  obj_again = JSON(obj_json)
@@ -325,12 +325,12 @@ class TC_JSON < Test::Unit::TestCase
325
325
  assert_equal ["foo"], JSON(JSON(SubArray2["foo"]))
326
326
  end
327
327
 
328
- def test_generation_of_core_subclasses_with_default_to_json
328
+ def test_generate_core_subclasses_with_default_to_json
329
329
  assert_equal '{"foo":"bar"}', JSON(SubHash["foo" => "bar"])
330
330
  assert_equal '["foo"]', JSON(SubArray["foo"])
331
331
  end
332
332
 
333
- def test_generation_of_core_subclasses
333
+ def test_generate_of_core_subclasses
334
334
  obj = SubHash["foo" => SubHash["bar" => true]]
335
335
  obj_json = JSON(obj)
336
336
  obj_again = JSON(obj_json)
@@ -227,23 +227,25 @@ EOT
227
227
  GC.stress = stress
228
228
  end if GC.respond_to?(:stress=)
229
229
 
230
- def test_broken_bignum # [ruby-core:38867]
231
- pid = fork do
232
- Bignum.class_eval do
233
- def to_s
230
+ if defined?(JSON::Ext::Generator)
231
+ def test_broken_bignum # [ruby-core:38867]
232
+ pid = fork do
233
+ Bignum.class_eval do
234
+ def to_s
235
+ end
236
+ end
237
+ begin
238
+ JSON::Ext::Generator::State.new.generate(1<<64)
239
+ exit 1
240
+ rescue TypeError
241
+ exit 0
234
242
  end
235
243
  end
236
- begin
237
- JSON::Ext::Generator::State.new.generate(1<<64)
238
- exit 1
239
- rescue TypeError
240
- exit 0
241
- end
244
+ _, status = Process.waitpid2(pid)
245
+ assert status.success?
246
+ rescue NotImplementedError
247
+ # forking to avoid modifying core class of a parent process and
248
+ # introducing race conditions of tests are run in parallel
242
249
  end
243
- _, status = Process.waitpid2(pid)
244
- assert status.success?
245
- rescue NotImplementedError
246
- # forking to avoid modifying core class of a parent process and
247
- # introducing race conditions of tests are run in parallel
248
- end if defined?(JSON::Ext)
250
+ end
249
251
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: json
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.6.5
5
+ version: 1.6.6
6
6
  platform: java
7
7
  authors:
8
8
  - Daniel Luz
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-15 00:00:00 Z
13
+ date: 2012-03-26 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: A JSON implementation as a JRuby extension.
@@ -23,66 +23,66 @@ extra_rdoc_files: []
23
23
 
24
24
  files:
25
25
  - lib/json.rb
26
- - lib/json/version.rb
27
26
  - lib/json/common.rb
28
27
  - lib/json/ext.rb
29
28
  - lib/json/pure.rb
30
- - lib/json/add/symbol.rb
31
- - lib/json/add/struct.rb
32
- - lib/json/add/complex.rb
33
- - lib/json/add/rational.rb
34
- - lib/json/add/exception.rb
35
- - lib/json/add/time.rb
29
+ - lib/json/version.rb
36
30
  - lib/json/add/bigdecimal.rb
37
- - lib/json/add/date_time.rb
31
+ - lib/json/add/complex.rb
38
32
  - lib/json/add/core.rb
39
- - lib/json/add/range.rb
40
33
  - lib/json/add/date.rb
41
- - lib/json/add/regexp.rb
34
+ - lib/json/add/date_time.rb
35
+ - lib/json/add/exception.rb
42
36
  - lib/json/add/ostruct.rb
43
- - lib/json/pure/generator.rb
44
- - lib/json/pure/parser.rb
37
+ - lib/json/add/range.rb
38
+ - lib/json/add/rational.rb
39
+ - lib/json/add/regexp.rb
40
+ - lib/json/add/struct.rb
41
+ - lib/json/add/symbol.rb
42
+ - lib/json/add/time.rb
45
43
  - lib/json/ext/generator.jar
46
44
  - lib/json/ext/parser.jar
47
- - tests/test_json_string_matching.rb
48
- - tests/test_json_fixtures.rb
45
+ - lib/json/pure/generator.rb
46
+ - lib/json/pure/parser.rb
49
47
  - tests/setup_variant.rb
50
- - tests/test_json_unicode.rb
48
+ - tests/test_json.rb
51
49
  - tests/test_json_addition.rb
52
- - tests/test_json_generate.rb
53
50
  - tests/test_json_encoding.rb
54
- - tests/test_json.rb
55
- - tests/fixtures/fail6.json
56
- - tests/fixtures/fail9.json
51
+ - tests/test_json_fixtures.rb
52
+ - tests/test_json_generate.rb
53
+ - tests/test_json_string_matching.rb
54
+ - tests/test_json_unicode.rb
55
+ - tests/fixtures/fail1.json
57
56
  - tests/fixtures/fail10.json
58
- - tests/fixtures/fail24.json
59
- - tests/fixtures/fail28.json
60
- - tests/fixtures/fail13.json
61
- - tests/fixtures/fail4.json
62
- - tests/fixtures/pass3.json
63
57
  - tests/fixtures/fail11.json
64
- - tests/fixtures/fail14.json
65
- - tests/fixtures/fail3.json
66
58
  - tests/fixtures/fail12.json
67
- - tests/fixtures/pass16.json
68
- - tests/fixtures/pass15.json
69
- - tests/fixtures/fail20.json
70
- - tests/fixtures/fail8.json
71
- - tests/fixtures/pass2.json
72
- - tests/fixtures/fail5.json
73
- - tests/fixtures/fail1.json
74
- - tests/fixtures/fail25.json
75
- - tests/fixtures/pass17.json
76
- - tests/fixtures/fail7.json
77
- - tests/fixtures/pass26.json
78
- - tests/fixtures/fail21.json
79
- - tests/fixtures/pass1.json
80
- - tests/fixtures/fail23.json
59
+ - tests/fixtures/fail13.json
60
+ - tests/fixtures/fail14.json
81
61
  - tests/fixtures/fail18.json
62
+ - tests/fixtures/fail19.json
82
63
  - tests/fixtures/fail2.json
64
+ - tests/fixtures/fail20.json
65
+ - tests/fixtures/fail21.json
83
66
  - tests/fixtures/fail22.json
67
+ - tests/fixtures/fail23.json
68
+ - tests/fixtures/fail24.json
69
+ - tests/fixtures/fail25.json
84
70
  - tests/fixtures/fail27.json
85
- - tests/fixtures/fail19.json
71
+ - tests/fixtures/fail28.json
72
+ - tests/fixtures/fail3.json
73
+ - tests/fixtures/fail4.json
74
+ - tests/fixtures/fail5.json
75
+ - tests/fixtures/fail6.json
76
+ - tests/fixtures/fail7.json
77
+ - tests/fixtures/fail8.json
78
+ - tests/fixtures/fail9.json
79
+ - tests/fixtures/pass1.json
80
+ - tests/fixtures/pass15.json
81
+ - tests/fixtures/pass16.json
82
+ - tests/fixtures/pass17.json
83
+ - tests/fixtures/pass2.json
84
+ - tests/fixtures/pass26.json
85
+ - tests/fixtures/pass3.json
86
86
  homepage: http://json-jruby.rubyforge.org/
87
87
  licenses: []
88
88
 
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  requirements: []
113
113
 
114
114
  rubyforge_project: json-jruby
115
- rubygems_version: 1.8.9
115
+ rubygems_version: 1.8.21
116
116
  signing_key:
117
117
  specification_version: 3
118
118
  summary: JSON implementation for JRuby