json 1.5.5 → 1.6.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.
- data/CHANGES +3 -7
- data/Gemfile +0 -4
- data/Rakefile +0 -7
- data/VERSION +1 -1
- data/ext/json/ext/parser/parser.c +18 -18
- data/ext/json/ext/parser/parser.rl +1 -4
- data/install.rb +1 -8
- data/java/src/json/ext/Parser.java +85 -81
- data/java/src/json/ext/Parser.rl +1 -1
- data/json.gemspec +5 -6
- data/json_pure.gemspec +4 -8
- data/lib/json/add/core.rb +9 -244
- data/lib/json/add/date.rb +34 -0
- data/lib/json/add/date_time.rb +50 -0
- data/lib/json/add/exception.rb +31 -0
- data/lib/json/add/range.rb +29 -0
- data/lib/json/add/regexp.rb +30 -0
- data/lib/json/add/struct.rb +30 -0
- data/lib/json/add/symbol.rb +25 -0
- data/lib/json/add/time.rb +35 -0
- data/lib/json/common.rb +5 -12
- data/lib/json/pure/parser.rb +4 -4
- data/lib/json/version.rb +1 -1
- data/tests/test_json.rb +2 -22
- data/tests/test_json_addition.rb +21 -29
- data/tests/test_json_string_matching.rb +6 -5
- data/tools/server.rb +1 -0
- metadata +124 -152
- data/0001-Security-fix-create_additons-JSON-GenericObject.patch +0 -448
- data/0001-Security-fix-create_additons-problem-1.5.5.patch +0 -630
- data/0001-Security-fix-for-create_additions-problem-1.6.8.patch +0 -685
- data/Gemfile.lock +0 -60
- data/bin/edit_json.rb +0 -9
- data/bin/prettify_json.rb +0 -48
- data/lib/json/Array.xpm +0 -21
- data/lib/json/FalseClass.xpm +0 -21
- data/lib/json/Hash.xpm +0 -21
- data/lib/json/Key.xpm +0 -73
- data/lib/json/NilClass.xpm +0 -21
- data/lib/json/Numeric.xpm +0 -28
- data/lib/json/String.xpm +0 -96
- data/lib/json/TrueClass.xpm +0 -21
- data/lib/json/editor.rb +0 -1369
- data/lib/json/json.xpm +0 -1499
@@ -0,0 +1,29 @@
|
|
1
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
2
|
+
require 'json'
|
3
|
+
end
|
4
|
+
|
5
|
+
# Range serialization/deserialization
|
6
|
+
class Range
|
7
|
+
|
8
|
+
# Deserializes JSON string by constructing new Range object with arguments
|
9
|
+
# <tt>a</tt> serialized by <tt>to_json</tt>.
|
10
|
+
def self.json_create(object)
|
11
|
+
new(*object['a'])
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
15
|
+
# object.
|
16
|
+
def as_json(*)
|
17
|
+
{
|
18
|
+
JSON.create_id => self.class.name,
|
19
|
+
'a' => [ first, last, exclude_end? ]
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Stores class name (Range) with JSON array of arguments <tt>a</tt> which
|
24
|
+
# include <tt>first</tt> (integer), <tt>last</tt> (integer), and
|
25
|
+
# <tt>exclude_end?</tt> (boolean) as JSON string.
|
26
|
+
def to_json(*args)
|
27
|
+
as_json.to_json(*args)
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
2
|
+
require 'json'
|
3
|
+
end
|
4
|
+
|
5
|
+
# Regexp serialization/deserialization
|
6
|
+
class Regexp
|
7
|
+
|
8
|
+
# Deserializes JSON string by constructing new Regexp object with source
|
9
|
+
# <tt>s</tt> (Regexp or String) and options <tt>o</tt> serialized by
|
10
|
+
# <tt>to_json</tt>
|
11
|
+
def self.json_create(object)
|
12
|
+
new(object['s'], object['o'])
|
13
|
+
end
|
14
|
+
|
15
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
16
|
+
# object.
|
17
|
+
def as_json(*)
|
18
|
+
{
|
19
|
+
JSON.create_id => self.class.name,
|
20
|
+
'o' => options,
|
21
|
+
's' => source,
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Stores class name (Regexp) with options <tt>o</tt> and source <tt>s</tt>
|
26
|
+
# (Regexp or String) as JSON string
|
27
|
+
def to_json(*)
|
28
|
+
as_json.to_json
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
2
|
+
require 'json'
|
3
|
+
end
|
4
|
+
|
5
|
+
# Struct serialization/deserialization
|
6
|
+
class Struct
|
7
|
+
|
8
|
+
# Deserializes JSON string by constructing new Struct object with values
|
9
|
+
# <tt>v</tt> serialized by <tt>to_json</tt>.
|
10
|
+
def self.json_create(object)
|
11
|
+
new(*object['v'])
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
15
|
+
# object.
|
16
|
+
def as_json(*)
|
17
|
+
klass = self.class.name
|
18
|
+
klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
|
19
|
+
{
|
20
|
+
JSON.create_id => klass,
|
21
|
+
'v' => values,
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Stores class name (Struct) with Struct values <tt>v</tt> as a JSON string.
|
26
|
+
# Only named structs are supported.
|
27
|
+
def to_json(*args)
|
28
|
+
as_json.to_json(*args)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
2
|
+
require 'json'
|
3
|
+
end
|
4
|
+
|
5
|
+
# Symbol serialization/deserialization
|
6
|
+
class Symbol
|
7
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
8
|
+
# object.
|
9
|
+
def as_json(*)
|
10
|
+
{
|
11
|
+
JSON.create_id => self.class.name,
|
12
|
+
's' => to_s,
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
# Stores class name (Symbol) with String representation of Symbol as a JSON string.
|
17
|
+
def to_json(*a)
|
18
|
+
as_json.to_json(*a)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Deserializes JSON string by converting the <tt>string</tt> value stored in the object to a Symbol
|
22
|
+
def self.json_create(o)
|
23
|
+
o['s'].to_sym
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
2
|
+
require 'json'
|
3
|
+
end
|
4
|
+
|
5
|
+
# Time serialization/deserialization
|
6
|
+
class Time
|
7
|
+
|
8
|
+
# Deserializes JSON string by converting time since epoch to Time
|
9
|
+
def self.json_create(object)
|
10
|
+
if usec = object.delete('u') # used to be tv_usec -> tv_nsec
|
11
|
+
object['n'] = usec * 1000
|
12
|
+
end
|
13
|
+
if respond_to?(:tv_nsec)
|
14
|
+
at(*object.values_at('s', 'n'))
|
15
|
+
else
|
16
|
+
at(object['s'], object['n'] / 1000)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
21
|
+
# object.
|
22
|
+
def as_json(*)
|
23
|
+
{
|
24
|
+
JSON.create_id => self.class.name,
|
25
|
+
's' => tv_sec,
|
26
|
+
'n' => respond_to?(:tv_nsec) ? tv_nsec : tv_usec * 1000
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Stores class name (Time) with number of seconds since epoch and number of
|
31
|
+
# microseconds for Time as JSON string
|
32
|
+
def to_json(*args)
|
33
|
+
as_json.to_json(*args)
|
34
|
+
end
|
35
|
+
end
|
data/lib/json/common.rb
CHANGED
@@ -141,7 +141,7 @@ module JSON
|
|
141
141
|
# the default.
|
142
142
|
# * *create_additions*: If set to false, the Parser doesn't create
|
143
143
|
# additions even if a matching class and create_id was found. This option
|
144
|
-
# defaults to
|
144
|
+
# defaults to true.
|
145
145
|
# * *object_class*: Defaults to Hash
|
146
146
|
# * *array_class*: Defaults to Array
|
147
147
|
def parse(source, opts = {})
|
@@ -162,7 +162,7 @@ module JSON
|
|
162
162
|
# to true.
|
163
163
|
# * *create_additions*: If set to false, the Parser doesn't create
|
164
164
|
# additions even if a matching class and create_id was found. This option
|
165
|
-
# defaults to
|
165
|
+
# defaults to true.
|
166
166
|
def parse!(source, opts = {})
|
167
167
|
opts = {
|
168
168
|
:max_nesting => false,
|
@@ -287,18 +287,11 @@ module JSON
|
|
287
287
|
# Load a ruby data structure from a JSON _source_ and return it. A source can
|
288
288
|
# either be a string-like object, an IO-like object, or an object responding
|
289
289
|
# to the read method. If _proc_ was given, it will be called with any nested
|
290
|
-
# Ruby object as an argument recursively in depth first order.
|
291
|
-
# default options pass in the optional _options_ argument as well.
|
290
|
+
# Ruby object as an argument recursively in depth first order.
|
292
291
|
#
|
293
292
|
# This method is part of the implementation of the load/dump interface of
|
294
293
|
# Marshal and YAML.
|
295
|
-
def load(source, proc = nil
|
296
|
-
load_default_options = {
|
297
|
-
:max_nesting => false,
|
298
|
-
:allow_nan => true,
|
299
|
-
:create_additions => false
|
300
|
-
}
|
301
|
-
opts = load_default_options.merge options
|
294
|
+
def load(source, proc = nil)
|
302
295
|
if source.respond_to? :to_str
|
303
296
|
source = source.to_str
|
304
297
|
elsif source.respond_to? :to_io
|
@@ -306,7 +299,7 @@ module JSON
|
|
306
299
|
else
|
307
300
|
source = source.read
|
308
301
|
end
|
309
|
-
result = parse(source,
|
302
|
+
result = parse(source, :max_nesting => false, :allow_nan => true)
|
310
303
|
recurse_proc(result, &proc) if proc
|
311
304
|
result
|
312
305
|
end
|
data/lib/json/pure/parser.rb
CHANGED
@@ -63,9 +63,9 @@ module JSON
|
|
63
63
|
# * *symbolize_names*: If set to true, returns symbols for the names
|
64
64
|
# (keys) in a JSON object. Otherwise strings are returned, which is also
|
65
65
|
# the default.
|
66
|
-
# * *create_additions*: If set to
|
67
|
-
# additions
|
68
|
-
#
|
66
|
+
# * *create_additions*: If set to false, the Parser doesn't create
|
67
|
+
# additions even if a matchin class and create_id was found. This option
|
68
|
+
# defaults to true.
|
69
69
|
# * *object_class*: Defaults to Hash
|
70
70
|
# * *array_class*: Defaults to Array
|
71
71
|
# * *quirks_mode*: Enables quirks_mode for parser, that is for example
|
@@ -88,7 +88,7 @@ module JSON
|
|
88
88
|
if opts.key?(:create_additions)
|
89
89
|
@create_additions = !!opts[:create_additions]
|
90
90
|
else
|
91
|
-
@create_additions =
|
91
|
+
@create_additions = true
|
92
92
|
end
|
93
93
|
@create_id = @create_additions ? JSON.create_id : nil
|
94
94
|
@object_class = opts[:object_class] || Hash
|
data/lib/json/version.rb
CHANGED
data/tests/test_json.rb
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
require 'test/unit'
|
5
5
|
require File.join(File.dirname(__FILE__), 'setup_variant')
|
6
6
|
require 'stringio'
|
7
|
-
require 'tempfile'
|
8
7
|
|
9
8
|
unless Array.method_defined?(:permutation)
|
10
9
|
begin
|
@@ -264,12 +263,12 @@ class TC_JSON < Test::Unit::TestCase
|
|
264
263
|
def test_generation_of_core_subclasses_with_new_to_json
|
265
264
|
obj = SubHash2["foo" => SubHash2["bar" => true]]
|
266
265
|
obj_json = JSON(obj)
|
267
|
-
obj_again = JSON
|
266
|
+
obj_again = JSON(obj_json)
|
268
267
|
assert_kind_of SubHash2, obj_again
|
269
268
|
assert_kind_of SubHash2, obj_again['foo']
|
270
269
|
assert obj_again['foo']['bar']
|
271
270
|
assert_equal obj, obj_again
|
272
|
-
assert_equal ["foo"], JSON(JSON(SubArray2["foo"])
|
271
|
+
assert_equal ["foo"], JSON(JSON(SubArray2["foo"]))
|
273
272
|
end
|
274
273
|
|
275
274
|
def test_generation_of_core_subclasses_with_default_to_json
|
@@ -415,25 +414,6 @@ EOT
|
|
415
414
|
JSON.parse('{"foo":"bar", "baz":"quux"}', :symbolize_names => true))
|
416
415
|
end
|
417
416
|
|
418
|
-
def test_load
|
419
|
-
assert_equal @hash, JSON.load(@json)
|
420
|
-
tempfile = Tempfile.open('json')
|
421
|
-
tempfile.write @json
|
422
|
-
tempfile.rewind
|
423
|
-
assert_equal @hash, JSON.load(tempfile)
|
424
|
-
stringio = StringIO.new(@json)
|
425
|
-
stringio.rewind
|
426
|
-
assert_equal @hash, JSON.load(stringio)
|
427
|
-
assert_raise(NoMethodError) { JSON.load(nil) }
|
428
|
-
assert_raise(JSON::ParserError) {JSON.load('') }
|
429
|
-
end
|
430
|
-
|
431
|
-
def test_load_with_options
|
432
|
-
small_hash = JSON("foo" => 'bar')
|
433
|
-
symbol_hash = { :foo => 'bar' }
|
434
|
-
assert_equal symbol_hash, JSON.load(small_hash, nil, :symbolize_names => true)
|
435
|
-
end
|
436
|
-
|
437
417
|
def test_load_dump
|
438
418
|
too_deep = '[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]'
|
439
419
|
assert_equal too_deep, JSON.dump(eval(too_deep))
|
data/tests/test_json_addition.rb
CHANGED
@@ -71,19 +71,11 @@ class TC_JSONAddition < Test::Unit::TestCase
|
|
71
71
|
a = A.new(666)
|
72
72
|
assert A.json_creatable?
|
73
73
|
json = generate(a)
|
74
|
-
a_again = JSON.parse(json
|
74
|
+
a_again = JSON.parse(json)
|
75
75
|
assert_kind_of a.class, a_again
|
76
76
|
assert_equal a, a_again
|
77
77
|
end
|
78
78
|
|
79
|
-
def test_extended_json_default
|
80
|
-
a = A.new(666)
|
81
|
-
assert A.json_creatable?
|
82
|
-
json = generate(a)
|
83
|
-
a_hash = JSON.parse(json)
|
84
|
-
assert_kind_of Hash, a_hash
|
85
|
-
end
|
86
|
-
|
87
79
|
def test_extended_json_disabled
|
88
80
|
a = A.new(666)
|
89
81
|
assert A.json_creatable?
|
@@ -110,7 +102,7 @@ class TC_JSONAddition < Test::Unit::TestCase
|
|
110
102
|
c = C.new
|
111
103
|
assert !C.json_creatable?
|
112
104
|
json = generate(c)
|
113
|
-
assert_raises(ArgumentError, NameError) { JSON.parse(json
|
105
|
+
assert_raises(ArgumentError, NameError) { JSON.parse(json) }
|
114
106
|
end
|
115
107
|
|
116
108
|
def test_raw_strings
|
@@ -128,7 +120,7 @@ class TC_JSONAddition < Test::Unit::TestCase
|
|
128
120
|
assert_match(/\A\{.*\}\Z/, json)
|
129
121
|
assert_match(/"json_class":"String"/, json)
|
130
122
|
assert_match(/"raw":\[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255\]/, json)
|
131
|
-
raw_again = JSON.parse(json
|
123
|
+
raw_again = JSON.parse(json)
|
132
124
|
assert_equal raw, raw_again
|
133
125
|
end
|
134
126
|
|
@@ -136,17 +128,17 @@ class TC_JSONAddition < Test::Unit::TestCase
|
|
136
128
|
|
137
129
|
def test_core
|
138
130
|
t = Time.now
|
139
|
-
assert_equal t, JSON(JSON(t)
|
131
|
+
assert_equal t.inspect, JSON(JSON(t)).inspect
|
140
132
|
d = Date.today
|
141
|
-
assert_equal d, JSON(JSON(d)
|
133
|
+
assert_equal d, JSON(JSON(d))
|
142
134
|
d = DateTime.civil(2007, 6, 14, 14, 57, 10, Rational(1, 12), 2299161)
|
143
|
-
assert_equal d, JSON(JSON(d)
|
144
|
-
assert_equal 1..10, JSON(JSON(1..10)
|
145
|
-
assert_equal 1...10, JSON(JSON(1...10)
|
146
|
-
assert_equal "a".."c", JSON(JSON("a".."c")
|
147
|
-
assert_equal "a"..."c", JSON(JSON("a"..."c")
|
135
|
+
assert_equal d, JSON(JSON(d))
|
136
|
+
assert_equal 1..10, JSON(JSON(1..10))
|
137
|
+
assert_equal 1...10, JSON(JSON(1...10))
|
138
|
+
assert_equal "a".."c", JSON(JSON("a".."c"))
|
139
|
+
assert_equal "a"..."c", JSON(JSON("a"..."c"))
|
148
140
|
s = MyJsonStruct.new 4711, 'foot'
|
149
|
-
assert_equal s, JSON(JSON(s)
|
141
|
+
assert_equal s, JSON(JSON(s))
|
150
142
|
struct = Struct.new :foo, :bar
|
151
143
|
s = struct.new 4711, 'foot'
|
152
144
|
assert_raises(JSONError) { JSON(s) }
|
@@ -154,29 +146,29 @@ class TC_JSONAddition < Test::Unit::TestCase
|
|
154
146
|
raise TypeError, "test me"
|
155
147
|
rescue TypeError => e
|
156
148
|
e_json = JSON.generate e
|
157
|
-
e_again = JSON e_json
|
149
|
+
e_again = JSON e_json
|
158
150
|
assert_kind_of TypeError, e_again
|
159
151
|
assert_equal e.message, e_again.message
|
160
152
|
assert_equal e.backtrace, e_again.backtrace
|
161
153
|
end
|
162
|
-
assert_equal(/foo/, JSON(JSON(/foo/)
|
163
|
-
assert_equal(/foo/i, JSON(JSON(/foo/i)
|
154
|
+
assert_equal(/foo/, JSON(JSON(/foo/)))
|
155
|
+
assert_equal(/foo/i, JSON(JSON(/foo/i)))
|
164
156
|
end
|
165
157
|
|
166
158
|
def test_utc_datetime
|
167
159
|
now = Time.now
|
168
|
-
d = DateTime.parse(now.to_s
|
169
|
-
assert_equal d, JSON.parse(d.to_json
|
160
|
+
d = DateTime.parse(now.to_s) # usual case
|
161
|
+
assert_equal d, JSON.parse(d.to_json)
|
170
162
|
d = DateTime.parse(now.utc.to_s) # of = 0
|
171
|
-
assert_equal d, JSON.parse(d.to_json
|
163
|
+
assert_equal d, JSON.parse(d.to_json)
|
172
164
|
d = DateTime.civil(2008, 6, 17, 11, 48, 32, Rational(1,24))
|
173
|
-
assert_equal d, JSON.parse(d.to_json
|
165
|
+
assert_equal d, JSON.parse(d.to_json)
|
174
166
|
d = DateTime.civil(2008, 6, 17, 11, 48, 32, Rational(12,24))
|
175
|
-
assert_equal d, JSON.parse(d.to_json
|
167
|
+
assert_equal d, JSON.parse(d.to_json)
|
176
168
|
end
|
177
169
|
|
178
170
|
def test_rational_complex
|
179
|
-
assert_equal Rational(2, 9), JSON
|
180
|
-
assert_equal Complex(2, 9), JSON
|
171
|
+
assert_equal Rational(2, 9), JSON(JSON(Rational(2, 9)))
|
172
|
+
assert_equal Complex(2, 9), JSON(JSON(Complex(2, 9)))
|
181
173
|
end
|
182
174
|
end
|
@@ -27,13 +27,14 @@ class TestJsonStringMatching < Test::Unit::TestCase
|
|
27
27
|
t = TestTime.new
|
28
28
|
t_json = [ t ].to_json
|
29
29
|
assert_equal [ t ],
|
30
|
-
JSON.parse(t_json,
|
31
|
-
:match_string => { /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\
|
30
|
+
JSON.parse(t_json,
|
31
|
+
:match_string => { /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\Z/ => TestTime })
|
32
32
|
assert_equal [ t.strftime('%FT%T%z') ],
|
33
|
-
JSON.parse(t_json,
|
34
|
-
:match_string => { /\A\d{3}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\
|
33
|
+
JSON.parse(t_json,
|
34
|
+
:match_string => { /\A\d{3}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\Z/ => TestTime })
|
35
35
|
assert_equal [ t.strftime('%FT%T%z') ],
|
36
36
|
JSON.parse(t_json,
|
37
|
-
:match_string => { /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\
|
37
|
+
:match_string => { /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\Z/ => TestTime },
|
38
|
+
:create_additions => false)
|
38
39
|
end
|
39
40
|
end
|
data/tools/server.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2011-09-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: permutation
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2152879580 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
24
|
+
version_requirements: *2152879580
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: bullshit
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &2152879140 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ! '>='
|
@@ -37,15 +32,10 @@ dependencies:
|
|
37
32
|
version: '0'
|
38
33
|
type: :development
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
35
|
+
version_requirements: *2152879140
|
46
36
|
- !ruby/object:Gem::Dependency
|
47
37
|
name: sdoc
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &2152878720 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
40
|
requirements:
|
51
41
|
- - ! '>='
|
@@ -53,164 +43,149 @@ dependencies:
|
|
53
43
|
version: '0'
|
54
44
|
type: :development
|
55
45
|
prerelease: false
|
56
|
-
version_requirements:
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
46
|
+
version_requirements: *2152878720
|
62
47
|
description: This is a JSON implementation as a Ruby extension in C.
|
63
48
|
email: flori@ping.de
|
64
|
-
executables:
|
65
|
-
- edit_json.rb
|
66
|
-
- prettify_json.rb
|
49
|
+
executables: []
|
67
50
|
extensions:
|
68
|
-
- ext/json/ext/generator/extconf.rb
|
69
51
|
- ext/json/ext/parser/extconf.rb
|
52
|
+
- ext/json/ext/generator/extconf.rb
|
70
53
|
extra_rdoc_files:
|
71
54
|
- README.rdoc
|
72
55
|
files:
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
56
|
+
- tests/test_json_string_matching.rb
|
57
|
+
- tests/test_json_fixtures.rb
|
58
|
+
- tests/setup_variant.rb
|
59
|
+
- tests/fixtures/fail6.json
|
60
|
+
- tests/fixtures/fail9.json
|
61
|
+
- tests/fixtures/fail10.json
|
62
|
+
- tests/fixtures/fail24.json
|
63
|
+
- tests/fixtures/fail28.json
|
64
|
+
- tests/fixtures/fail13.json
|
65
|
+
- tests/fixtures/fail4.json
|
66
|
+
- tests/fixtures/pass3.json
|
67
|
+
- tests/fixtures/fail11.json
|
68
|
+
- tests/fixtures/fail14.json
|
69
|
+
- tests/fixtures/fail3.json
|
70
|
+
- tests/fixtures/fail12.json
|
71
|
+
- tests/fixtures/pass16.json
|
72
|
+
- tests/fixtures/pass15.json
|
73
|
+
- tests/fixtures/fail20.json
|
74
|
+
- tests/fixtures/fail8.json
|
75
|
+
- tests/fixtures/pass2.json
|
76
|
+
- tests/fixtures/fail5.json
|
77
|
+
- tests/fixtures/fail1.json
|
78
|
+
- tests/fixtures/fail25.json
|
79
|
+
- tests/fixtures/pass17.json
|
80
|
+
- tests/fixtures/fail7.json
|
81
|
+
- tests/fixtures/pass26.json
|
82
|
+
- tests/fixtures/fail21.json
|
83
|
+
- tests/fixtures/pass1.json
|
84
|
+
- tests/fixtures/fail23.json
|
85
|
+
- tests/fixtures/fail18.json
|
86
|
+
- tests/fixtures/fail2.json
|
87
|
+
- tests/fixtures/fail22.json
|
88
|
+
- tests/fixtures/fail27.json
|
89
|
+
- tests/fixtures/fail19.json
|
90
|
+
- tests/test_json_unicode.rb
|
91
|
+
- tests/test_json_addition.rb
|
92
|
+
- tests/test_json_generate.rb
|
93
|
+
- tests/test_json_encoding.rb
|
94
|
+
- tests/test_json.rb
|
77
95
|
- COPYING
|
78
|
-
- COPYING-json-jruby
|
79
|
-
- GPL
|
80
|
-
- Gemfile
|
81
|
-
- Gemfile.lock
|
82
|
-
- README-json-jruby.markdown
|
83
|
-
- README.rdoc
|
84
|
-
- Rakefile
|
85
96
|
- TODO
|
86
|
-
-
|
87
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
88
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
89
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
90
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
91
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
92
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat
|
93
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat
|
94
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log
|
95
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat
|
96
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat
|
97
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat
|
98
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat
|
99
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat
|
97
|
+
- Rakefile
|
98
|
+
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat
|
99
|
+
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log
|
100
|
+
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log
|
101
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log
|
102
|
+
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log
|
100
103
|
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat
|
101
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
102
|
-
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat
|
104
|
+
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat
|
103
105
|
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat
|
104
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
105
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
106
|
-
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat
|
107
|
-
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat
|
108
|
-
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log
|
106
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log
|
107
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat
|
109
108
|
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat
|
109
|
+
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat
|
110
110
|
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat
|
111
|
-
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log
|
112
111
|
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat
|
112
|
+
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log
|
113
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat
|
114
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat
|
115
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat
|
116
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log
|
113
117
|
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat
|
114
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
118
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log
|
119
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat
|
120
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat
|
121
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat
|
122
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat
|
123
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat
|
124
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat
|
125
|
+
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log
|
126
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat
|
115
127
|
- benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat
|
116
|
-
- benchmarks/data-p4-3GHz-ruby18/
|
117
|
-
- benchmarks/
|
128
|
+
- benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat
|
129
|
+
- benchmarks/parser2_benchmark.rb
|
130
|
+
- benchmarks/parser_benchmark.rb
|
118
131
|
- benchmarks/generator2_benchmark.rb
|
119
132
|
- benchmarks/generator_benchmark.rb
|
120
|
-
- benchmarks/ohai.json
|
121
133
|
- benchmarks/ohai.ruby
|
122
|
-
- benchmarks/
|
123
|
-
-
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
+
- benchmarks/ohai.json
|
135
|
+
- lib/json/version.rb
|
136
|
+
- lib/json/add/symbol.rb
|
137
|
+
- lib/json/add/struct.rb
|
138
|
+
- lib/json/add/complex.rb
|
139
|
+
- lib/json/add/rational.rb
|
140
|
+
- lib/json/add/exception.rb
|
141
|
+
- lib/json/add/time.rb
|
142
|
+
- lib/json/add/date_time.rb
|
143
|
+
- lib/json/add/core.rb
|
144
|
+
- lib/json/add/range.rb
|
145
|
+
- lib/json/add/date.rb
|
146
|
+
- lib/json/add/regexp.rb
|
147
|
+
- lib/json/common.rb
|
148
|
+
- lib/json/pure/generator.rb
|
149
|
+
- lib/json/pure/parser.rb
|
150
|
+
- lib/json/ext.rb
|
151
|
+
- lib/json/pure.rb
|
152
|
+
- lib/json.rb
|
153
|
+
- Gemfile
|
154
|
+
- README.rdoc
|
155
|
+
- json_pure.gemspec
|
156
|
+
- GPL
|
157
|
+
- CHANGES
|
158
|
+
- COPYING-json-jruby
|
134
159
|
- ext/json/ext/parser/parser.h
|
160
|
+
- ext/json/ext/parser/extconf.rb
|
135
161
|
- ext/json/ext/parser/parser.rl
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
162
|
+
- ext/json/ext/parser/parser.c
|
163
|
+
- ext/json/ext/generator/generator.c
|
164
|
+
- ext/json/ext/generator/extconf.rb
|
165
|
+
- ext/json/ext/generator/generator.h
|
166
|
+
- VERSION
|
167
|
+
- data/prototype.js
|
168
|
+
- data/index.html
|
169
|
+
- data/example.json
|
170
|
+
- json.gemspec
|
171
|
+
- java/src/json/ext/Parser.java
|
172
|
+
- java/src/json/ext/RuntimeInfo.java
|
143
173
|
- java/src/json/ext/GeneratorState.java
|
144
174
|
- java/src/json/ext/OptionsReader.java
|
145
|
-
- java/src/json/ext/Parser.java
|
146
|
-
- java/src/json/ext/Parser.rl
|
147
175
|
- java/src/json/ext/ParserService.java
|
148
|
-
- java/src/json/ext/
|
149
|
-
- java/src/json/ext/StringDecoder.java
|
176
|
+
- java/src/json/ext/Parser.rl
|
150
177
|
- java/src/json/ext/StringEncoder.java
|
178
|
+
- java/src/json/ext/GeneratorService.java
|
151
179
|
- java/src/json/ext/Utils.java
|
180
|
+
- java/src/json/ext/StringDecoder.java
|
181
|
+
- java/src/json/ext/Generator.java
|
182
|
+
- java/src/json/ext/ByteListTranscoder.java
|
183
|
+
- java/src/json/ext/GeneratorMethods.java
|
184
|
+
- java/lib/bytelist-1.0.6.jar
|
185
|
+
- java/lib/jcodings.jar
|
186
|
+
- README-json-jruby.markdown
|
187
|
+
- install.rb
|
152
188
|
- json-java.gemspec
|
153
|
-
- json.gemspec
|
154
|
-
- json_pure.gemspec
|
155
|
-
- lib/json.rb
|
156
|
-
- lib/json/Array.xpm
|
157
|
-
- lib/json/FalseClass.xpm
|
158
|
-
- lib/json/Hash.xpm
|
159
|
-
- lib/json/Key.xpm
|
160
|
-
- lib/json/NilClass.xpm
|
161
|
-
- lib/json/Numeric.xpm
|
162
|
-
- lib/json/String.xpm
|
163
|
-
- lib/json/TrueClass.xpm
|
164
|
-
- lib/json/add/complex.rb
|
165
|
-
- lib/json/add/core.rb
|
166
|
-
- lib/json/add/rational.rb
|
167
|
-
- lib/json/common.rb
|
168
|
-
- lib/json/editor.rb
|
169
|
-
- lib/json/ext.rb
|
170
|
-
- lib/json/json.xpm
|
171
|
-
- lib/json/pure.rb
|
172
|
-
- lib/json/pure/generator.rb
|
173
|
-
- lib/json/pure/parser.rb
|
174
|
-
- lib/json/version.rb
|
175
|
-
- tests/fixtures/fail1.json
|
176
|
-
- tests/fixtures/fail10.json
|
177
|
-
- tests/fixtures/fail11.json
|
178
|
-
- tests/fixtures/fail12.json
|
179
|
-
- tests/fixtures/fail13.json
|
180
|
-
- tests/fixtures/fail14.json
|
181
|
-
- tests/fixtures/fail18.json
|
182
|
-
- tests/fixtures/fail19.json
|
183
|
-
- tests/fixtures/fail2.json
|
184
|
-
- tests/fixtures/fail20.json
|
185
|
-
- tests/fixtures/fail21.json
|
186
|
-
- tests/fixtures/fail22.json
|
187
|
-
- tests/fixtures/fail23.json
|
188
|
-
- tests/fixtures/fail24.json
|
189
|
-
- tests/fixtures/fail25.json
|
190
|
-
- tests/fixtures/fail27.json
|
191
|
-
- tests/fixtures/fail28.json
|
192
|
-
- tests/fixtures/fail3.json
|
193
|
-
- tests/fixtures/fail4.json
|
194
|
-
- tests/fixtures/fail5.json
|
195
|
-
- tests/fixtures/fail6.json
|
196
|
-
- tests/fixtures/fail7.json
|
197
|
-
- tests/fixtures/fail8.json
|
198
|
-
- tests/fixtures/fail9.json
|
199
|
-
- tests/fixtures/pass1.json
|
200
|
-
- tests/fixtures/pass15.json
|
201
|
-
- tests/fixtures/pass16.json
|
202
|
-
- tests/fixtures/pass17.json
|
203
|
-
- tests/fixtures/pass2.json
|
204
|
-
- tests/fixtures/pass26.json
|
205
|
-
- tests/fixtures/pass3.json
|
206
|
-
- tests/setup_variant.rb
|
207
|
-
- tests/test_json.rb
|
208
|
-
- tests/test_json_addition.rb
|
209
|
-
- tests/test_json_encoding.rb
|
210
|
-
- tests/test_json_fixtures.rb
|
211
|
-
- tests/test_json_generate.rb
|
212
|
-
- tests/test_json_string_matching.rb
|
213
|
-
- tests/test_json_unicode.rb
|
214
189
|
- tools/fuzz.rb
|
215
190
|
- tools/server.rb
|
216
191
|
- ./tests/test_json_string_matching.rb
|
@@ -238,9 +213,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
238
213
|
- - ! '>='
|
239
214
|
- !ruby/object:Gem::Version
|
240
215
|
version: '0'
|
241
|
-
segments:
|
242
|
-
- 0
|
243
|
-
hash: -399171405044678908
|
244
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
217
|
none: false
|
246
218
|
requirements:
|
@@ -249,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
221
|
version: '0'
|
250
222
|
requirements: []
|
251
223
|
rubyforge_project: json
|
252
|
-
rubygems_version: 1.8.
|
224
|
+
rubygems_version: 1.8.10
|
253
225
|
signing_key:
|
254
226
|
specification_version: 3
|
255
227
|
summary: JSON Implementation for Ruby
|