ox 1.2.8 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ox might be problematic. Click here for more details.
- data/ext/ox/dump.c +8 -1
- data/lib/ox/version.rb +1 -1
- data/test/big.rb +24 -0
- data/test/bug3.rb +23 -0
- metadata +14 -4
data/ext/ox/dump.c
CHANGED
@@ -597,7 +597,14 @@ dump_obj(ID aid, VALUE obj, unsigned int depth, Out out) {
|
|
597
597
|
e.indent = -1;
|
598
598
|
out->w_end(out, &e);
|
599
599
|
} else {
|
600
|
-
|
600
|
+
if (StrictEffort == out->opts->effort) {
|
601
|
+
rb_raise(rb_eNotImpError, "Failed to dump RUBY_T_DATA %s Object (%02x)\n",
|
602
|
+
rb_class2name(clas), rb_type(obj));
|
603
|
+
} else {
|
604
|
+
e.type = NilClassCode;
|
605
|
+
e.closed = 1;
|
606
|
+
out->w_start(out, &e);
|
607
|
+
}
|
601
608
|
}
|
602
609
|
break;
|
603
610
|
}
|
data/lib/ox/version.rb
CHANGED
data/test/big.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby -wW1
|
2
|
+
|
3
|
+
$: << '../lib'
|
4
|
+
$: << '../ext'
|
5
|
+
|
6
|
+
if __FILE__ == $0
|
7
|
+
while (i = ARGV.index('-I'))
|
8
|
+
x,path = ARGV.slice!(i, 2)
|
9
|
+
$: << path
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'ox'
|
14
|
+
|
15
|
+
def dump(cnt = 10000)
|
16
|
+
h = { }
|
17
|
+
cnt.times do |i|
|
18
|
+
h[i] = [i * 2, "this is #{i}"]
|
19
|
+
end
|
20
|
+
xml = Ox.dump(h)
|
21
|
+
puts "size: #{xml.size}"
|
22
|
+
end
|
23
|
+
|
24
|
+
dump(200000)
|
data/test/bug3.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env ruby -wW1
|
2
|
+
|
3
|
+
$: << '../lib'
|
4
|
+
$: << '../ext'
|
5
|
+
|
6
|
+
if __FILE__ == $0
|
7
|
+
if (i = ARGV.index('-I'))
|
8
|
+
x,path = ARGV.slice!(i, 2)
|
9
|
+
$: << path
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'ox'
|
14
|
+
|
15
|
+
def dump(cnt = 100000)
|
16
|
+
cnt.times do |i|
|
17
|
+
xml = Ox.dump([:inc, 1])
|
18
|
+
#puts xml
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
dump()
|
metadata
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 2
|
8
|
+
- 9
|
9
|
+
version: 1.2.9
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
12
|
- Peter Ohler
|
@@ -10,7 +14,7 @@ autorequire:
|
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
16
|
|
13
|
-
date: 2011-08-
|
17
|
+
date: 2011-08-25 00:00:00 +09:00
|
14
18
|
default_executable:
|
15
19
|
dependencies: []
|
16
20
|
|
@@ -47,8 +51,10 @@ files:
|
|
47
51
|
- ext/ox/obj_load.c
|
48
52
|
- ext/ox/ox.c
|
49
53
|
- ext/ox/parse.c
|
54
|
+
- test/big.rb
|
50
55
|
- test/bug1.rb
|
51
56
|
- test/bug2.rb
|
57
|
+
- test/bug3.rb
|
52
58
|
- test/cache16_test.rb
|
53
59
|
- test/cache8_test.rb
|
54
60
|
- test/cache_test.rb
|
@@ -94,17 +100,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
100
|
requirements:
|
95
101
|
- - ">="
|
96
102
|
- !ruby/object:Gem::Version
|
103
|
+
segments:
|
104
|
+
- 0
|
97
105
|
version: "0"
|
98
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
107
|
none: false
|
100
108
|
requirements:
|
101
109
|
- - ">="
|
102
110
|
- !ruby/object:Gem::Version
|
111
|
+
segments:
|
112
|
+
- 0
|
103
113
|
version: "0"
|
104
114
|
requirements: []
|
105
115
|
|
106
116
|
rubyforge_project: ox
|
107
|
-
rubygems_version: 1.
|
117
|
+
rubygems_version: 1.3.7
|
108
118
|
signing_key:
|
109
119
|
specification_version: 3
|
110
120
|
summary: A fast XML parser and object serializer.
|