wankel 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/LICENSE +20 -0
- data/README.md +43 -0
- data/Rakefile +63 -0
- data/benchmark/subjects/item.json +1 -0
- data/benchmark/subjects/ohai.json +1216 -0
- data/benchmark/subjects/twitter_search.json +1 -0
- data/benchmark/subjects/twitter_stream.json +430 -0
- data/ext/wankel/extconf.rb +15 -0
- data/ext/wankel/wankel.c +50 -0
- data/ext/wankel/wankel.h +17 -0
- data/ext/wankel/wankel_encoder.c +232 -0
- data/ext/wankel/wankel_encoder.h +13 -0
- data/ext/wankel/wankel_parser.c +345 -0
- data/ext/wankel/wankel_parser.h +26 -0
- data/ext/wankel/wankel_sax_encoder.c +290 -0
- data/ext/wankel/wankel_sax_encoder.h +13 -0
- data/ext/wankel/wankel_sax_parser.c +232 -0
- data/ext/wankel/wankel_sax_parser.h +23 -0
- data/ext/wankel/yajl_helpers.c +124 -0
- data/ext/wankel/yajl_helpers.h +22 -0
- data/lib/wankel/ex_sax_parser.rb +75 -0
- data/lib/wankel.rb +19 -0
- data/logo.png +0 -0
- data/test/encoding/encoding_test.rb +230 -0
- data/test/encoding/sax_encoder_test.rb +89 -0
- data/test/parsing/active_support_test.rb +66 -0
- data/test/parsing/fixtures/fail.15.json +1 -0
- data/test/parsing/fixtures/fail.16.json +1 -0
- data/test/parsing/fixtures/fail.17.json +1 -0
- data/test/parsing/fixtures/fail.26.json +1 -0
- data/test/parsing/fixtures/fail11.json +1 -0
- data/test/parsing/fixtures/fail12.json +1 -0
- data/test/parsing/fixtures/fail13.json +1 -0
- data/test/parsing/fixtures/fail14.json +1 -0
- data/test/parsing/fixtures/fail19.json +1 -0
- data/test/parsing/fixtures/fail20.json +1 -0
- data/test/parsing/fixtures/fail21.json +1 -0
- data/test/parsing/fixtures/fail22.json +1 -0
- data/test/parsing/fixtures/fail23.json +1 -0
- data/test/parsing/fixtures/fail24.json +1 -0
- data/test/parsing/fixtures/fail25.json +1 -0
- data/test/parsing/fixtures/fail27.json +2 -0
- data/test/parsing/fixtures/fail28.json +2 -0
- data/test/parsing/fixtures/fail3.json +1 -0
- data/test/parsing/fixtures/fail4.json +1 -0
- data/test/parsing/fixtures/fail5.json +1 -0
- data/test/parsing/fixtures/fail6.json +1 -0
- data/test/parsing/fixtures/fail9.json +1 -0
- data/test/parsing/fixtures/pass.array.json +6 -0
- data/test/parsing/fixtures/pass.codepoints_from_unicode_org.json +1 -0
- data/test/parsing/fixtures/pass.contacts.json +1 -0
- data/test/parsing/fixtures/pass.db100.xml.json +1 -0
- data/test/parsing/fixtures/pass.db1000.xml.json +1 -0
- data/test/parsing/fixtures/pass.dc_simple_with_comments.json +11 -0
- data/test/parsing/fixtures/pass.deep_arrays.json +1 -0
- data/test/parsing/fixtures/pass.difficult_json_c_test_case.json +1 -0
- data/test/parsing/fixtures/pass.difficult_json_c_test_case_with_comments.json +1 -0
- data/test/parsing/fixtures/pass.doubles.json +1 -0
- data/test/parsing/fixtures/pass.empty_array.json +1 -0
- data/test/parsing/fixtures/pass.empty_string.json +1 -0
- data/test/parsing/fixtures/pass.escaped_bulgarian.json +4 -0
- data/test/parsing/fixtures/pass.escaped_foobar.json +1 -0
- data/test/parsing/fixtures/pass.item.json +1 -0
- data/test/parsing/fixtures/pass.json-org-sample1.json +23 -0
- data/test/parsing/fixtures/pass.json-org-sample2.json +11 -0
- data/test/parsing/fixtures/pass.json-org-sample3.json +26 -0
- data/test/parsing/fixtures/pass.json-org-sample4-nows.json +88 -0
- data/test/parsing/fixtures/pass.json-org-sample4.json +89 -0
- data/test/parsing/fixtures/pass.json-org-sample5.json +27 -0
- data/test/parsing/fixtures/pass.map-spain.xml.json +1 -0
- data/test/parsing/fixtures/pass.ns-invoice100.xml.json +1 -0
- data/test/parsing/fixtures/pass.ns-soap.xml.json +1 -0
- data/test/parsing/fixtures/pass.numbers-fp-4k.json +6 -0
- data/test/parsing/fixtures/pass.numbers-fp-64k.json +61 -0
- data/test/parsing/fixtures/pass.numbers-int-4k.json +11 -0
- data/test/parsing/fixtures/pass.numbers-int-64k.json +154 -0
- data/test/parsing/fixtures/pass.twitter-search.json +1 -0
- data/test/parsing/fixtures/pass.twitter-search2.json +1 -0
- data/test/parsing/fixtures/pass.unicode.json +3315 -0
- data/test/parsing/fixtures/pass.yelp.json +1 -0
- data/test/parsing/fixtures/pass1.json +56 -0
- data/test/parsing/fixtures/pass2.json +1 -0
- data/test/parsing/fixtures/pass3.json +6 -0
- data/test/parsing/fixtures_test.rb +43 -0
- data/test/parsing/multiple_values_test.rb +100 -0
- data/test/parsing/one_off_test.rb +65 -0
- data/test/parsing/sax_parser_test.rb +125 -0
- data/test/performance.rb +135 -0
- data/test/test_helper.rb +36 -0
- data/test/wankel_test.rb +53 -0
- data/wankel.gemspec +23 -0
- metadata +259 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
require 'test_helper'
|
|
3
|
+
|
|
4
|
+
class TestParser < Wankel::SaxParser
|
|
5
|
+
def on_map_start
|
|
6
|
+
end
|
|
7
|
+
def on_map_end
|
|
8
|
+
end
|
|
9
|
+
def on_map_key(key)
|
|
10
|
+
end
|
|
11
|
+
def on_null
|
|
12
|
+
end
|
|
13
|
+
def on_boolean(value)
|
|
14
|
+
end
|
|
15
|
+
def on_integer(i)
|
|
16
|
+
end
|
|
17
|
+
def on_double(d)
|
|
18
|
+
end
|
|
19
|
+
def on_string(s)
|
|
20
|
+
end
|
|
21
|
+
def on_array_start
|
|
22
|
+
end
|
|
23
|
+
def on_array_end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
class Wankel::SaxParserTest < ::Test::Unit::TestCase
|
|
28
|
+
|
|
29
|
+
test 'default inherited from Wankel' do
|
|
30
|
+
parser = TestParser.new
|
|
31
|
+
parser.instance_variable_get("@options") == Wankel::DEFAULTS
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
test 'default inherited from Wankel && Class' do
|
|
35
|
+
class TestParser2 < Wankel::SaxParser
|
|
36
|
+
DEFAULTS = {:hello => true}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
parser = TestParser2.new
|
|
40
|
+
parser.instance_variable_get("@options") == Wankel::DEFAULTS.merge({:hello => true})
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
test 'default options merged with options inherited from Wankel && Class' do
|
|
44
|
+
class TestParser3 < Wankel::SaxParser
|
|
45
|
+
DEFAULTS = {:hello => true}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
parser = TestParser3.new(:metoo => false)
|
|
49
|
+
parser.instance_variable_get("@options") == Wankel::DEFAULTS.merge({:hello => true, :metoo => false})
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
test "on_map_start callback" do
|
|
53
|
+
parser = TestParser.new
|
|
54
|
+
parser.expects(:on_map_start).twice
|
|
55
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,1.0,{}, true]}")
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
test "on_map_end callback" do
|
|
59
|
+
parser = TestParser.new
|
|
60
|
+
parser.expects(:on_map_end).twice
|
|
61
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,1.0,{}, true]}")
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
test "on_map_key callback" do
|
|
65
|
+
parser = TestParser.new
|
|
66
|
+
parser.expects(:on_map_key).twice
|
|
67
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,1.0,{}, true]}")
|
|
68
|
+
|
|
69
|
+
# TODO when reseting parser avail reset
|
|
70
|
+
parser = TestParser.new
|
|
71
|
+
parser.expects(:on_map_key).once.with('id')
|
|
72
|
+
parser.parse("{\"id\": 2147483649}")
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
test "on_map_null callback" do
|
|
76
|
+
parser = TestParser.new
|
|
77
|
+
parser.expects(:on_null).once
|
|
78
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,1.0,{}, true]}")
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
test "on_map_boolean callback" do
|
|
82
|
+
parser = TestParser.new
|
|
83
|
+
parser.expects(:on_boolean).once.with(true)
|
|
84
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,1.0,{}, true]}")
|
|
85
|
+
|
|
86
|
+
parser = TestParser.new
|
|
87
|
+
parser.expects(:on_boolean).once.with(false)
|
|
88
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,1.0,{}, false]}")
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
test "on_integer callback" do
|
|
92
|
+
parser = TestParser.new
|
|
93
|
+
parser.expects(:on_integer).twice
|
|
94
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,1.0,{}, true]}")
|
|
95
|
+
|
|
96
|
+
parser = TestParser.new
|
|
97
|
+
parser.expects(:on_integer).once.with(2147483649)
|
|
98
|
+
parser.parse("{\"id\": 2147483649}")
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
test "on_double callback" do
|
|
102
|
+
parser = TestParser.new
|
|
103
|
+
parser.expects(:on_double).once.with(1.0)
|
|
104
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,1.0,{}, true]}")
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
test "on_string callback" do
|
|
108
|
+
parser = TestParser.new
|
|
109
|
+
parser.expects(:on_string).once.with("data")
|
|
110
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,\"data\",1.0,{}, true]}")
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
test "on_array_start callback" do
|
|
114
|
+
parser = TestParser.new
|
|
115
|
+
parser.expects(:on_array_start).once
|
|
116
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,\"data\",1.0,{}, true]}")
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
test "on_array_end callback" do
|
|
120
|
+
parser = TestParser.new
|
|
121
|
+
parser.expects(:on_array_end).once
|
|
122
|
+
parser.parse("{\"id\": 2147483649,\"key\": [1,null,\"data\",1.0,{}, true]}")
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
end
|
data/test/performance.rb
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# To make testing/debugging easier, test within this source tree versus an
|
|
2
|
+
# installed gem
|
|
3
|
+
dir = File.dirname(__FILE__)
|
|
4
|
+
root = File.expand_path(File.join(dir, '..'))
|
|
5
|
+
lib = File.expand_path(File.join(root, 'lib'))
|
|
6
|
+
|
|
7
|
+
$LOAD_PATH << lib
|
|
8
|
+
|
|
9
|
+
require 'oj'
|
|
10
|
+
require 'json'
|
|
11
|
+
require 'yajl'
|
|
12
|
+
require 'wankel'
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Perf
|
|
16
|
+
|
|
17
|
+
def initialize()
|
|
18
|
+
@items = []
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def add(title, op, &blk)
|
|
22
|
+
@items << Item.new(title, op, &blk)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def before(title, &blk)
|
|
26
|
+
@items.each do |i|
|
|
27
|
+
if title == i.title
|
|
28
|
+
i.set_before(&blk)
|
|
29
|
+
break
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def run(iter)
|
|
35
|
+
base = Item.new(nil, nil) { }
|
|
36
|
+
base.run(iter, 0.0)
|
|
37
|
+
@items.each do |i|
|
|
38
|
+
i.run(iter, base.duration)
|
|
39
|
+
if i.error.nil?
|
|
40
|
+
puts "#{i.title}.#{i.op} #{iter} times in %0.3f seconds or %0.3f #{i.op}/sec." % [i.duration, iter / i.duration]
|
|
41
|
+
else
|
|
42
|
+
puts "***** #{i.title}.#{i.op} failed! #{i.error}"
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
summary()
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def summary()
|
|
49
|
+
fastest = nil
|
|
50
|
+
slowest = nil
|
|
51
|
+
width = 6
|
|
52
|
+
@items.each do |i|
|
|
53
|
+
next if i.duration.nil?
|
|
54
|
+
width = i.title.size if width < i.title.size
|
|
55
|
+
end
|
|
56
|
+
iva = @items.clone
|
|
57
|
+
iva.delete_if { |i| i.duration.nil? }
|
|
58
|
+
iva = iva.sort_by { |i| i.duration }
|
|
59
|
+
puts
|
|
60
|
+
puts "Summary:"
|
|
61
|
+
puts "%*s time (secs) rate (ops/sec)" % [width, 'System']
|
|
62
|
+
puts "#{'-' * width} ----------- --------------"
|
|
63
|
+
iva.each do |i|
|
|
64
|
+
if i.duration.nil?
|
|
65
|
+
else
|
|
66
|
+
puts "%*s %11.3f %14.3f" % [width, i.title, i.duration, i.rate ]
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
puts
|
|
70
|
+
puts "Comparison Matrix\n(performance factor, 2.0 means row is twice as fast as column)"
|
|
71
|
+
puts ([' ' * width] + iva.map { |i| "%*s" % [width, i.title] }).join(' ')
|
|
72
|
+
puts (['-' * width] + iva.map { |i| '-' * width }).join(' ')
|
|
73
|
+
iva.each do |i|
|
|
74
|
+
line = ["%*s" % [width, i.title]]
|
|
75
|
+
iva.each do |o|
|
|
76
|
+
line << "%*.2f" % [width, o.duration / i.duration]
|
|
77
|
+
end
|
|
78
|
+
puts line.join(' ')
|
|
79
|
+
end
|
|
80
|
+
puts
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class Item
|
|
84
|
+
attr_accessor :title
|
|
85
|
+
attr_accessor :op
|
|
86
|
+
attr_accessor :blk
|
|
87
|
+
attr_accessor :duration
|
|
88
|
+
attr_accessor :rate
|
|
89
|
+
attr_accessor :error
|
|
90
|
+
|
|
91
|
+
def initialize(title, op, &blk)
|
|
92
|
+
@title = title
|
|
93
|
+
@blk = blk
|
|
94
|
+
@op = op
|
|
95
|
+
@duration = nil
|
|
96
|
+
@rate = nil
|
|
97
|
+
@error = nil
|
|
98
|
+
@before = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def set_before(&blk)
|
|
102
|
+
@before = blk
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def run(iter, base)
|
|
106
|
+
begin
|
|
107
|
+
GC.start
|
|
108
|
+
@before.call unless @before.nil?
|
|
109
|
+
start = Time.now
|
|
110
|
+
iter.times { @blk.call }
|
|
111
|
+
@duration = Time.now - start - base
|
|
112
|
+
@duration = 0.0 if @duration < 0.0
|
|
113
|
+
@rate = iter / @duration
|
|
114
|
+
rescue Exception => e
|
|
115
|
+
@error = "#{e.class}: #{e.message}"
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
end # Item
|
|
120
|
+
end # Perf
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@json = '{"a":"Alpha","b":true,"c":12345,"d":[true,[false,{"12345":12345,"nil":null},3.967,{"x":"something","y":false,"z":true},null]],"e":{"one":1,"two":2},"f":null,"g":12345678901234567890123456789,"h":{"a":{"b":{"c":{"d":{"e":{"f":{"g":null}}}}}}},"i":[[[[[[[null]]]]]]]}'
|
|
124
|
+
@json = '{}'
|
|
125
|
+
@json = File.read('./benchmark/subjects/ohai.json')
|
|
126
|
+
|
|
127
|
+
puts '-' * 80
|
|
128
|
+
puts "Parse Performance"
|
|
129
|
+
perf = Perf.new()
|
|
130
|
+
perf.add('JSON::Ext', 'parse') { JSON::Ext::Parser.new(@json).parse }
|
|
131
|
+
perf.add('Yajl', 'parse') { Yajl::Parser.parse(@json) }
|
|
132
|
+
perf.add('Oj::Doc', 'parse') { Oj.load(@json) }
|
|
133
|
+
parser = Wankel::Parser.new()
|
|
134
|
+
perf.add('Wankel', 'parse') { parser.parse(@json) }
|
|
135
|
+
perf.run(1000)
|
data/test/test_helper.rb
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
if ENV['COVERALLS_REPO_TOKEN']
|
|
2
|
+
require 'simplecov'
|
|
3
|
+
SimpleCov.start do
|
|
4
|
+
add_filter "/test/"
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# To make testing/debugging easier, test within this source tree versus an
|
|
9
|
+
# installed gem
|
|
10
|
+
dir = File.dirname(__FILE__)
|
|
11
|
+
root = File.expand_path(File.join(dir, '..'))
|
|
12
|
+
lib = File.expand_path(File.join(root, 'lib'))
|
|
13
|
+
|
|
14
|
+
$LOAD_PATH << lib
|
|
15
|
+
|
|
16
|
+
require 'turn'
|
|
17
|
+
require 'test/unit'
|
|
18
|
+
require "mocha/setup"
|
|
19
|
+
require 'wankel'
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# File 'lib/active_support/testing/declarative.rb', somewhere in rails....
|
|
23
|
+
class ::Test::Unit::TestCase
|
|
24
|
+
def self.test(name, &block)
|
|
25
|
+
test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
|
|
26
|
+
defined = instance_method(test_name) rescue false
|
|
27
|
+
raise "#{test_name} is already defined in #{self}" if defined
|
|
28
|
+
if block_given?
|
|
29
|
+
define_method(test_name, &block)
|
|
30
|
+
else
|
|
31
|
+
define_method(test_name) do
|
|
32
|
+
flunk "No implementation provided for #{name}"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
data/test/wankel_test.rb
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class WankelTest < ::Test::Unit::TestCase
|
|
4
|
+
|
|
5
|
+
test "dump should exist as a class-method" do
|
|
6
|
+
assert(Wankel.respond_to?(:dump))
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
test "dump should be able to encode to a string" do
|
|
10
|
+
assert_equal('{"a":1234}', Wankel.dump({:a => 1234}))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
test "dump should be able to encode to an IO" do
|
|
14
|
+
io = StringIO.new
|
|
15
|
+
Wankel.dump({:a => 1234}, io)
|
|
16
|
+
io.rewind
|
|
17
|
+
assert_equal('{"a":1234}', io.read)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
test "load should exist as a class-method" do
|
|
21
|
+
assert(Wankel.respond_to?(:load))
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
test "load should be able to parse from a string" do
|
|
25
|
+
assert_equal({"a" => 1234}, Wankel.load('{"a":1234}'))
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
test "load should be able to parse from an IO" do
|
|
29
|
+
io = StringIO.new('{"a":1234}')
|
|
30
|
+
assert_equal({"a" => 1234}, Wankel.load(io))
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
test "load should be able to parse from a string with a block supplied" do
|
|
34
|
+
Wankel.load('{"a":1234}') do |h|
|
|
35
|
+
assert_equal({"a" => 1234}, h)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
test "load should be able to parse from an IO with a block supplied" do
|
|
40
|
+
io = StringIO.new('{"a":1234}')
|
|
41
|
+
Wankel.load(io) do |h|
|
|
42
|
+
assert_equal({"a" => 1234}, h)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
test "If I cause a segfault after GC runs I've failed" do
|
|
47
|
+
io = StringIO.new
|
|
48
|
+
assert_raises TypeError do
|
|
49
|
+
Wankel.parse({:a => 1234}, io)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
data/wankel.gemspec
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Gem::Specification.new do |s|
|
|
2
|
+
s.name = 'wankel'
|
|
3
|
+
s.version = '0.1.0'
|
|
4
|
+
s.authors = ['Jon Bracy']
|
|
5
|
+
s.email = ['jonbracy@gmail.com']
|
|
6
|
+
s.homepage = 'http://wankelrb.com'
|
|
7
|
+
s.summary = 'SAX based JSON parser and encoder'
|
|
8
|
+
s.description = 'SAX based JSON parser and encoder'
|
|
9
|
+
|
|
10
|
+
s.rubyforge_project = "wankel"
|
|
11
|
+
|
|
12
|
+
s.files = `git ls-files`.split("\n")
|
|
13
|
+
s.extensions = ['ext/wankel/extconf.rb']
|
|
14
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
15
|
+
s.require_paths = ['lib']
|
|
16
|
+
|
|
17
|
+
s.required_ruby_version = '>= 2.0.0'
|
|
18
|
+
|
|
19
|
+
s.add_development_dependency 'rake-compiler'
|
|
20
|
+
s.add_development_dependency 'minitest'
|
|
21
|
+
s.add_development_dependency 'turn'
|
|
22
|
+
s.add_development_dependency 'mocha'
|
|
23
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: wankel
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jon Bracy
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2013-11-11 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rake-compiler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - '>='
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - '>='
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: minitest
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - '>='
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - '>='
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: turn
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - '>='
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - '>='
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: mocha
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - '>='
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - '>='
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
description: SAX based JSON parser and encoder
|
|
70
|
+
email:
|
|
71
|
+
- jonbracy@gmail.com
|
|
72
|
+
executables: []
|
|
73
|
+
extensions:
|
|
74
|
+
- ext/wankel/extconf.rb
|
|
75
|
+
extra_rdoc_files: []
|
|
76
|
+
files:
|
|
77
|
+
- .gitignore
|
|
78
|
+
- LICENSE
|
|
79
|
+
- README.md
|
|
80
|
+
- Rakefile
|
|
81
|
+
- benchmark/subjects/item.json
|
|
82
|
+
- benchmark/subjects/ohai.json
|
|
83
|
+
- benchmark/subjects/twitter_search.json
|
|
84
|
+
- benchmark/subjects/twitter_stream.json
|
|
85
|
+
- ext/wankel/extconf.rb
|
|
86
|
+
- ext/wankel/wankel.c
|
|
87
|
+
- ext/wankel/wankel.h
|
|
88
|
+
- ext/wankel/wankel_encoder.c
|
|
89
|
+
- ext/wankel/wankel_encoder.h
|
|
90
|
+
- ext/wankel/wankel_parser.c
|
|
91
|
+
- ext/wankel/wankel_parser.h
|
|
92
|
+
- ext/wankel/wankel_sax_encoder.c
|
|
93
|
+
- ext/wankel/wankel_sax_encoder.h
|
|
94
|
+
- ext/wankel/wankel_sax_parser.c
|
|
95
|
+
- ext/wankel/wankel_sax_parser.h
|
|
96
|
+
- ext/wankel/yajl_helpers.c
|
|
97
|
+
- ext/wankel/yajl_helpers.h
|
|
98
|
+
- lib/wankel.rb
|
|
99
|
+
- lib/wankel/ex_sax_parser.rb
|
|
100
|
+
- logo.png
|
|
101
|
+
- test/encoding/encoding_test.rb
|
|
102
|
+
- test/encoding/sax_encoder_test.rb
|
|
103
|
+
- test/parsing/active_support_test.rb
|
|
104
|
+
- test/parsing/fixtures/fail.15.json
|
|
105
|
+
- test/parsing/fixtures/fail.16.json
|
|
106
|
+
- test/parsing/fixtures/fail.17.json
|
|
107
|
+
- test/parsing/fixtures/fail.26.json
|
|
108
|
+
- test/parsing/fixtures/fail11.json
|
|
109
|
+
- test/parsing/fixtures/fail12.json
|
|
110
|
+
- test/parsing/fixtures/fail13.json
|
|
111
|
+
- test/parsing/fixtures/fail14.json
|
|
112
|
+
- test/parsing/fixtures/fail19.json
|
|
113
|
+
- test/parsing/fixtures/fail20.json
|
|
114
|
+
- test/parsing/fixtures/fail21.json
|
|
115
|
+
- test/parsing/fixtures/fail22.json
|
|
116
|
+
- test/parsing/fixtures/fail23.json
|
|
117
|
+
- test/parsing/fixtures/fail24.json
|
|
118
|
+
- test/parsing/fixtures/fail25.json
|
|
119
|
+
- test/parsing/fixtures/fail27.json
|
|
120
|
+
- test/parsing/fixtures/fail28.json
|
|
121
|
+
- test/parsing/fixtures/fail3.json
|
|
122
|
+
- test/parsing/fixtures/fail4.json
|
|
123
|
+
- test/parsing/fixtures/fail5.json
|
|
124
|
+
- test/parsing/fixtures/fail6.json
|
|
125
|
+
- test/parsing/fixtures/fail9.json
|
|
126
|
+
- test/parsing/fixtures/pass.array.json
|
|
127
|
+
- test/parsing/fixtures/pass.codepoints_from_unicode_org.json
|
|
128
|
+
- test/parsing/fixtures/pass.contacts.json
|
|
129
|
+
- test/parsing/fixtures/pass.db100.xml.json
|
|
130
|
+
- test/parsing/fixtures/pass.db1000.xml.json
|
|
131
|
+
- test/parsing/fixtures/pass.dc_simple_with_comments.json
|
|
132
|
+
- test/parsing/fixtures/pass.deep_arrays.json
|
|
133
|
+
- test/parsing/fixtures/pass.difficult_json_c_test_case.json
|
|
134
|
+
- test/parsing/fixtures/pass.difficult_json_c_test_case_with_comments.json
|
|
135
|
+
- test/parsing/fixtures/pass.doubles.json
|
|
136
|
+
- test/parsing/fixtures/pass.empty_array.json
|
|
137
|
+
- test/parsing/fixtures/pass.empty_string.json
|
|
138
|
+
- test/parsing/fixtures/pass.escaped_bulgarian.json
|
|
139
|
+
- test/parsing/fixtures/pass.escaped_foobar.json
|
|
140
|
+
- test/parsing/fixtures/pass.item.json
|
|
141
|
+
- test/parsing/fixtures/pass.json-org-sample1.json
|
|
142
|
+
- test/parsing/fixtures/pass.json-org-sample2.json
|
|
143
|
+
- test/parsing/fixtures/pass.json-org-sample3.json
|
|
144
|
+
- test/parsing/fixtures/pass.json-org-sample4-nows.json
|
|
145
|
+
- test/parsing/fixtures/pass.json-org-sample4.json
|
|
146
|
+
- test/parsing/fixtures/pass.json-org-sample5.json
|
|
147
|
+
- test/parsing/fixtures/pass.map-spain.xml.json
|
|
148
|
+
- test/parsing/fixtures/pass.ns-invoice100.xml.json
|
|
149
|
+
- test/parsing/fixtures/pass.ns-soap.xml.json
|
|
150
|
+
- test/parsing/fixtures/pass.numbers-fp-4k.json
|
|
151
|
+
- test/parsing/fixtures/pass.numbers-fp-64k.json
|
|
152
|
+
- test/parsing/fixtures/pass.numbers-int-4k.json
|
|
153
|
+
- test/parsing/fixtures/pass.numbers-int-64k.json
|
|
154
|
+
- test/parsing/fixtures/pass.twitter-search.json
|
|
155
|
+
- test/parsing/fixtures/pass.twitter-search2.json
|
|
156
|
+
- test/parsing/fixtures/pass.unicode.json
|
|
157
|
+
- test/parsing/fixtures/pass.yelp.json
|
|
158
|
+
- test/parsing/fixtures/pass1.json
|
|
159
|
+
- test/parsing/fixtures/pass2.json
|
|
160
|
+
- test/parsing/fixtures/pass3.json
|
|
161
|
+
- test/parsing/fixtures_test.rb
|
|
162
|
+
- test/parsing/multiple_values_test.rb
|
|
163
|
+
- test/parsing/one_off_test.rb
|
|
164
|
+
- test/parsing/sax_parser_test.rb
|
|
165
|
+
- test/performance.rb
|
|
166
|
+
- test/test_helper.rb
|
|
167
|
+
- test/wankel_test.rb
|
|
168
|
+
- wankel.gemspec
|
|
169
|
+
homepage: http://wankelrb.com
|
|
170
|
+
licenses: []
|
|
171
|
+
metadata: {}
|
|
172
|
+
post_install_message:
|
|
173
|
+
rdoc_options: []
|
|
174
|
+
require_paths:
|
|
175
|
+
- lib
|
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - '>='
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: 2.0.0
|
|
181
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
|
+
requirements:
|
|
183
|
+
- - '>='
|
|
184
|
+
- !ruby/object:Gem::Version
|
|
185
|
+
version: '0'
|
|
186
|
+
requirements: []
|
|
187
|
+
rubyforge_project: wankel
|
|
188
|
+
rubygems_version: 2.0.7
|
|
189
|
+
signing_key:
|
|
190
|
+
specification_version: 4
|
|
191
|
+
summary: SAX based JSON parser and encoder
|
|
192
|
+
test_files:
|
|
193
|
+
- test/encoding/encoding_test.rb
|
|
194
|
+
- test/encoding/sax_encoder_test.rb
|
|
195
|
+
- test/parsing/active_support_test.rb
|
|
196
|
+
- test/parsing/fixtures/fail.15.json
|
|
197
|
+
- test/parsing/fixtures/fail.16.json
|
|
198
|
+
- test/parsing/fixtures/fail.17.json
|
|
199
|
+
- test/parsing/fixtures/fail.26.json
|
|
200
|
+
- test/parsing/fixtures/fail11.json
|
|
201
|
+
- test/parsing/fixtures/fail12.json
|
|
202
|
+
- test/parsing/fixtures/fail13.json
|
|
203
|
+
- test/parsing/fixtures/fail14.json
|
|
204
|
+
- test/parsing/fixtures/fail19.json
|
|
205
|
+
- test/parsing/fixtures/fail20.json
|
|
206
|
+
- test/parsing/fixtures/fail21.json
|
|
207
|
+
- test/parsing/fixtures/fail22.json
|
|
208
|
+
- test/parsing/fixtures/fail23.json
|
|
209
|
+
- test/parsing/fixtures/fail24.json
|
|
210
|
+
- test/parsing/fixtures/fail25.json
|
|
211
|
+
- test/parsing/fixtures/fail27.json
|
|
212
|
+
- test/parsing/fixtures/fail28.json
|
|
213
|
+
- test/parsing/fixtures/fail3.json
|
|
214
|
+
- test/parsing/fixtures/fail4.json
|
|
215
|
+
- test/parsing/fixtures/fail5.json
|
|
216
|
+
- test/parsing/fixtures/fail6.json
|
|
217
|
+
- test/parsing/fixtures/fail9.json
|
|
218
|
+
- test/parsing/fixtures/pass.array.json
|
|
219
|
+
- test/parsing/fixtures/pass.codepoints_from_unicode_org.json
|
|
220
|
+
- test/parsing/fixtures/pass.contacts.json
|
|
221
|
+
- test/parsing/fixtures/pass.db100.xml.json
|
|
222
|
+
- test/parsing/fixtures/pass.db1000.xml.json
|
|
223
|
+
- test/parsing/fixtures/pass.dc_simple_with_comments.json
|
|
224
|
+
- test/parsing/fixtures/pass.deep_arrays.json
|
|
225
|
+
- test/parsing/fixtures/pass.difficult_json_c_test_case.json
|
|
226
|
+
- test/parsing/fixtures/pass.difficult_json_c_test_case_with_comments.json
|
|
227
|
+
- test/parsing/fixtures/pass.doubles.json
|
|
228
|
+
- test/parsing/fixtures/pass.empty_array.json
|
|
229
|
+
- test/parsing/fixtures/pass.empty_string.json
|
|
230
|
+
- test/parsing/fixtures/pass.escaped_bulgarian.json
|
|
231
|
+
- test/parsing/fixtures/pass.escaped_foobar.json
|
|
232
|
+
- test/parsing/fixtures/pass.item.json
|
|
233
|
+
- test/parsing/fixtures/pass.json-org-sample1.json
|
|
234
|
+
- test/parsing/fixtures/pass.json-org-sample2.json
|
|
235
|
+
- test/parsing/fixtures/pass.json-org-sample3.json
|
|
236
|
+
- test/parsing/fixtures/pass.json-org-sample4-nows.json
|
|
237
|
+
- test/parsing/fixtures/pass.json-org-sample4.json
|
|
238
|
+
- test/parsing/fixtures/pass.json-org-sample5.json
|
|
239
|
+
- test/parsing/fixtures/pass.map-spain.xml.json
|
|
240
|
+
- test/parsing/fixtures/pass.ns-invoice100.xml.json
|
|
241
|
+
- test/parsing/fixtures/pass.ns-soap.xml.json
|
|
242
|
+
- test/parsing/fixtures/pass.numbers-fp-4k.json
|
|
243
|
+
- test/parsing/fixtures/pass.numbers-fp-64k.json
|
|
244
|
+
- test/parsing/fixtures/pass.numbers-int-4k.json
|
|
245
|
+
- test/parsing/fixtures/pass.numbers-int-64k.json
|
|
246
|
+
- test/parsing/fixtures/pass.twitter-search.json
|
|
247
|
+
- test/parsing/fixtures/pass.twitter-search2.json
|
|
248
|
+
- test/parsing/fixtures/pass.unicode.json
|
|
249
|
+
- test/parsing/fixtures/pass.yelp.json
|
|
250
|
+
- test/parsing/fixtures/pass1.json
|
|
251
|
+
- test/parsing/fixtures/pass2.json
|
|
252
|
+
- test/parsing/fixtures/pass3.json
|
|
253
|
+
- test/parsing/fixtures_test.rb
|
|
254
|
+
- test/parsing/multiple_values_test.rb
|
|
255
|
+
- test/parsing/one_off_test.rb
|
|
256
|
+
- test/parsing/sax_parser_test.rb
|
|
257
|
+
- test/performance.rb
|
|
258
|
+
- test/test_helper.rb
|
|
259
|
+
- test/wankel_test.rb
|