ox 1.2.5 → 1.2.6
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 +2 -3
- data/ext/ox/obj_load.c +6 -5
- data/ext/ox/ox.c +66 -61
- data/lib/ox/bag.rb +19 -12
- data/lib/ox/cdata.rb +1 -1
- data/lib/ox/comment.rb +1 -1
- data/lib/ox/doctype.rb +1 -1
- data/lib/ox/document.rb +4 -4
- data/lib/ox/element.rb +9 -7
- data/lib/ox/node.rb +2 -2
- data/lib/ox/version.rb +1 -1
- metadata +5 -4
- data/test/bug3.rb +0 -23
data/ext/ox/dump.c
CHANGED
@@ -539,8 +539,7 @@ dump_obj(ID aid, VALUE obj, unsigned int depth, Out out) {
|
|
539
539
|
dump_value(out, b64, size);
|
540
540
|
e.indent = -1;
|
541
541
|
out->w_end(out, &e);
|
542
|
-
|
543
|
-
if (sizeof(buf64) <= size) {
|
542
|
+
if (buf64 != b64) {
|
544
543
|
free(b64);
|
545
544
|
}
|
546
545
|
}
|
@@ -677,7 +676,7 @@ dump_obj(ID aid, VALUE obj, unsigned int depth, Out out) {
|
|
677
676
|
}
|
678
677
|
to_base64((u_char*)s, cnt, b64);
|
679
678
|
dump_value(out, b64, size);
|
680
|
-
if (
|
679
|
+
if (buf64 != b64) {
|
681
680
|
free(b64);
|
682
681
|
}
|
683
682
|
}
|
data/ext/ox/obj_load.c
CHANGED
@@ -100,15 +100,16 @@ resolve_classname(VALUE mod, const char *class_name, Effort effort) {
|
|
100
100
|
|
101
101
|
switch (effort) {
|
102
102
|
case TolerantEffort:
|
103
|
-
if (
|
104
|
-
clas =
|
103
|
+
if (rb_const_defined_at(mod, ci)) {
|
104
|
+
clas = rb_const_get_at(mod, ci);
|
105
105
|
} else {
|
106
106
|
clas = Qundef;
|
107
107
|
}
|
108
108
|
break;
|
109
109
|
case AutoEffort:
|
110
|
-
|
111
|
-
|
110
|
+
//printf("*** auto %s\n", class_name);
|
111
|
+
if (rb_const_defined_at(mod, ci)) {
|
112
|
+
clas = rb_const_get_at(mod, ci);
|
112
113
|
} else {
|
113
114
|
clas = rb_define_class_under(mod, class_name, ox_bag_clas);
|
114
115
|
}
|
@@ -116,7 +117,7 @@ resolve_classname(VALUE mod, const char *class_name, Effort effort) {
|
|
116
117
|
case StrictEffort:
|
117
118
|
default:
|
118
119
|
// raise an error if name is not defined
|
119
|
-
clas =
|
120
|
+
clas = rb_const_get_at(mod, ci);
|
120
121
|
break;
|
121
122
|
}
|
122
123
|
return clas;
|
data/ext/ox/ox.c
CHANGED
@@ -134,6 +134,7 @@ static void parse_dump_options(VALUE ropts, Options copts);
|
|
134
134
|
* - xsd_date: [true|false|nil] use XSD date format instead of decimal format
|
135
135
|
* - mode: [:object|:generic|:limited|nil] load method to use for XML
|
136
136
|
* - effort: [:strict|:tolerant|:auto_define] set the tolerance level for loading
|
137
|
+
* @return [Hash] all current option settings.
|
137
138
|
*/
|
138
139
|
static VALUE
|
139
140
|
get_def_opts(VALUE self) {
|
@@ -165,19 +166,21 @@ get_def_opts(VALUE self) {
|
|
165
166
|
return opts;
|
166
167
|
}
|
167
168
|
|
168
|
-
/* call-seq: default_options=(
|
169
|
+
/* call-seq: default_options=(opts)
|
169
170
|
*
|
170
|
-
* Sets the default options for load and dump.
|
171
|
-
*
|
172
|
-
*
|
173
|
-
*
|
174
|
-
*
|
175
|
-
*
|
176
|
-
*
|
177
|
-
*
|
178
|
-
*
|
179
|
-
*
|
180
|
-
*
|
171
|
+
* Sets the default options for load and dump.
|
172
|
+
* @param [Hash] opts options to change
|
173
|
+
* @param [Fixnum] :indent number of spaces to indent each element in an XML document
|
174
|
+
* @param [Fixnum] :trace trace level where 0 is silent
|
175
|
+
* @param [String] :encoding character encoding for the XML file
|
176
|
+
* @param [true|false|nil] :with_dtd include DTD in the dump
|
177
|
+
* @param [true|false|nil] :with_instruct include instructions in the dump
|
178
|
+
* @param [true|false|nil] :with_xml include XML prolog in the dump
|
179
|
+
* @param [true|false|nil] :circular support circular references while dumping
|
180
|
+
* @param [true|false|nil] :xsd_date use XSD date format instead of decimal format
|
181
|
+
* @param [:object|:generic|:limited|nil] :mode load method to use for XML
|
182
|
+
* @param [:strict|:tolerant|:auto_define] :effort set the tolerance level for loading
|
183
|
+
* @return [nil]
|
181
184
|
*/
|
182
185
|
static VALUE
|
183
186
|
set_def_opts(VALUE self, VALUE opts) {
|
@@ -261,7 +264,8 @@ set_def_opts(VALUE self, VALUE opts) {
|
|
261
264
|
* optimized XML formated String. For other formats use the more generic
|
262
265
|
* Ox.load() method. Raises an exception if the XML is malformed or the
|
263
266
|
* classes specified in the file are not valid.
|
264
|
-
* [
|
267
|
+
* @param [String] xml XML String in optimized Object format.
|
268
|
+
* @return [Object] deserialized Object.
|
265
269
|
*/
|
266
270
|
static VALUE
|
267
271
|
to_obj(VALUE self, VALUE ruby_xml) {
|
@@ -279,8 +283,9 @@ to_obj(VALUE self, VALUE ruby_xml) {
|
|
279
283
|
/* call-seq: parse(xml) => Ox::Document or Ox::Element
|
280
284
|
*
|
281
285
|
* Parses and XML document String into an Ox::Document or Ox::Element.
|
282
|
-
*
|
283
|
-
* [
|
286
|
+
* @param [String] xml XML String
|
287
|
+
* @return [Ox::Document or Ox::Element] parsed XML document.
|
288
|
+
* @raise [Exception] if the XML is malformed.
|
284
289
|
*/
|
285
290
|
static VALUE
|
286
291
|
to_gen(VALUE self, VALUE ruby_xml) {
|
@@ -360,17 +365,17 @@ load(char *xml, int argc, VALUE *argv, VALUE self) {
|
|
360
365
|
* Parses and XML document String into an Ox::Document, or Ox::Element, or
|
361
366
|
* Object depending on the options. Raises an exception if the XML is
|
362
367
|
* malformed or the classes specified are not valid.
|
363
|
-
* [xml
|
364
|
-
* [
|
365
|
-
*
|
366
|
-
*
|
367
|
-
*
|
368
|
-
*
|
369
|
-
*
|
370
|
-
*
|
371
|
-
*
|
372
|
-
*
|
373
|
-
*
|
368
|
+
* @param [String] xml XML String
|
369
|
+
* @param [Hash] options load options
|
370
|
+
* @param [:object|:generic|:limited] :mode format expected
|
371
|
+
* - *:object* - object format
|
372
|
+
* - *:generic* - read as a generic XML file
|
373
|
+
* - *:limited* - read as a generic XML file but with callbacks on text and elements events only
|
374
|
+
* @param [:strict|:tolerant|:auto_define] :effort effort to use when an undefined class is encountered, default: :strict
|
375
|
+
* - *:strict* - raise an NameError for missing classes and modules
|
376
|
+
* - *:tolerant* - return nil for missing classes and modules
|
377
|
+
* - *:auto_define* - auto define missing classes and modules
|
378
|
+
* @param [Fixnum] :trace trace level as a Fixnum, default: 0 (silent)
|
374
379
|
*/
|
375
380
|
static VALUE
|
376
381
|
load_str(int argc, VALUE *argv, VALUE self) {
|
@@ -388,17 +393,17 @@ load_str(int argc, VALUE *argv, VALUE self) {
|
|
388
393
|
* Parses and XML document from a file into an Ox::Document, or Ox::Element,
|
389
394
|
* or Object depending on the options. Raises an exception if the XML is
|
390
395
|
* malformed or the classes specified are not valid.
|
391
|
-
* [
|
392
|
-
* [
|
393
|
-
*
|
394
|
-
*
|
395
|
-
*
|
396
|
-
*
|
397
|
-
*
|
398
|
-
*
|
399
|
-
*
|
400
|
-
*
|
401
|
-
*
|
396
|
+
* @param [String] file_path file path to read the XML document from
|
397
|
+
* @param [Hash] options load options
|
398
|
+
* @param [:object|:generic|:limited] :mode format expected
|
399
|
+
* - *:object* - object format
|
400
|
+
* - *:generic* - read as a generic XML file
|
401
|
+
* - *:limited* - read as a generic XML file but with callbacks on text and elements events only
|
402
|
+
* @param [:strict|:tolerant|:auto_define] :effort effort to use when an undefined class is encountered, default: :strict
|
403
|
+
* - *:strict* - raise an NameError for missing classes and modules
|
404
|
+
* - *:tolerant* - return nil for missing classes and modules
|
405
|
+
* - *:auto_define* - auto define missing classes and modules
|
406
|
+
* @param [Fixnum] :trace trace level as a Fixnum, default: 0 (silent)
|
402
407
|
*/
|
403
408
|
static VALUE
|
404
409
|
load_file(int argc, VALUE *argv, VALUE self) {
|
@@ -492,14 +497,14 @@ parse_dump_options(VALUE ropts, Options copts) {
|
|
492
497
|
/* call-seq: dump(obj, options) => xml-string
|
493
498
|
*
|
494
499
|
* Dumps an Object (obj) to a string.
|
495
|
-
* [obj
|
496
|
-
* [
|
497
|
-
*
|
498
|
-
*
|
499
|
-
*
|
500
|
-
*
|
501
|
-
*
|
502
|
-
*
|
500
|
+
* @param [Object] obj Object to serialize as an XML document String
|
501
|
+
* @param [Hash] options formating options
|
502
|
+
* @param [Fixnum] :indent format expected
|
503
|
+
* @param [true|false] :xsd_date use XSD date format if true, default: false
|
504
|
+
* @param [true|false] :circular allow circular references, default: false
|
505
|
+
* @param [:strict|:tolerant] :effort effort to use when an undumpable object (e.g., IO) is encountered, default: :strict
|
506
|
+
* - *:strict* - raise an NotImplementedError if an undumpable object is encountered
|
507
|
+
* - *:tolerant* - replaces undumplable objects with nil
|
503
508
|
*/
|
504
509
|
static VALUE
|
505
510
|
dump(int argc, VALUE *argv, VALUE self) {
|
@@ -525,19 +530,19 @@ dump(int argc, VALUE *argv, VALUE self) {
|
|
525
530
|
/* call-seq: to_file(file_path, obj, options)
|
526
531
|
*
|
527
532
|
* Dumps an Object to the specified file.
|
528
|
-
* [
|
529
|
-
* [obj
|
530
|
-
* [options
|
531
|
-
*
|
532
|
-
*
|
533
|
-
*
|
534
|
-
*
|
535
|
-
*
|
536
|
-
*
|
533
|
+
* @param [String] file_path file path to write the XML document to
|
534
|
+
* @param [Object] obj Object to serialize as an XML document String
|
535
|
+
* @param [Hash] options formating options
|
536
|
+
* @param [Fixnum] :indent format expected
|
537
|
+
* @param [true|false] :xsd_date use XSD date format if true, default: false
|
538
|
+
* @param [true|false] :circular allow circular references, default: false
|
539
|
+
* @param [:strict|:tolerant] :effort effort to use when an undumpable object (e.g., IO) is encountered, default: :strict
|
540
|
+
* - *:strict* - raise an NotImplementedError if an undumpable object is encountered
|
541
|
+
* - *:tolerant* - replaces undumplable objects with nil
|
537
542
|
*/
|
538
543
|
static VALUE
|
539
544
|
to_file(int argc, VALUE *argv, VALUE self) {
|
540
|
-
struct _Options copts;
|
545
|
+
struct _Options copts = default_options;
|
541
546
|
|
542
547
|
if (3 == argc) {
|
543
548
|
parse_dump_options(argv[2], &copts);
|
@@ -632,12 +637,12 @@ void Init_ox() {
|
|
632
637
|
|
633
638
|
|
634
639
|
//rb_require("node"); // generic xml node classes
|
635
|
-
ox_document_clas =
|
636
|
-
ox_element_clas =
|
637
|
-
ox_comment_clas =
|
638
|
-
ox_doctype_clas =
|
639
|
-
ox_cdata_clas =
|
640
|
-
ox_bag_clas =
|
640
|
+
ox_document_clas = rb_const_get_at(Ox, rb_intern("Document"));
|
641
|
+
ox_element_clas = rb_const_get_at(Ox, rb_intern("Element"));
|
642
|
+
ox_comment_clas = rb_const_get_at(Ox, rb_intern("Comment"));
|
643
|
+
ox_doctype_clas = rb_const_get_at(Ox, rb_intern("DocType"));
|
644
|
+
ox_cdata_clas = rb_const_get_at(Ox, rb_intern("CData"));
|
645
|
+
ox_bag_clas = rb_const_get_at(Ox, rb_intern("Bag"));
|
641
646
|
|
642
647
|
ox_cache_new(&symbol_cache);
|
643
648
|
ox_cache_new(&class_cache);
|
data/lib/ox/bag.rb
CHANGED
@@ -11,7 +11,8 @@ module Ox
|
|
11
11
|
# The initializer can take multiple arguments in the form of key values
|
12
12
|
# where the key is the variable name and the value is the variable
|
13
13
|
# value. This is intended for testing purposes only.
|
14
|
-
#
|
14
|
+
# @example Ox::Bag.new(:@x => 42, :@y => 57)
|
15
|
+
# @param [Hash] args instance variable symbols and their values
|
15
16
|
def initialize(args={ })
|
16
17
|
args.each do |k,v|
|
17
18
|
self.instance_variable_set(k, v)
|
@@ -22,9 +23,10 @@ module Ox
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
# Replaces the Object.respond_to?() method
|
26
|
-
#
|
27
|
-
# [
|
26
|
+
# Replaces the Object.respond_to?() method.
|
27
|
+
# @param [Symbol] m method symbol
|
28
|
+
# @return [Boolean] true for any method that matches an instance
|
29
|
+
# variable reader, otherwise false.
|
28
30
|
def respond_to?(m)
|
29
31
|
at_m = ('@' + m.to_s).to_sym
|
30
32
|
instance_variables.include?(at_m)
|
@@ -32,16 +34,20 @@ module Ox
|
|
32
34
|
|
33
35
|
# Handles requests for variable values. Others cause an Exception to be
|
34
36
|
# raised.
|
35
|
-
# [
|
37
|
+
# @param [Symbol] m method symbol
|
38
|
+
# @return [Boolean] the value of the specified instance variable.
|
39
|
+
# @raise [ArgumentError] if an argument is given. Zero arguments expected.
|
40
|
+
# @raise [NoMethodError] if the instance variable is not defined.
|
36
41
|
def method_missing(m, *args, &block)
|
37
|
-
raise ArgumentError.new("wrong number of arguments(#{args.size} for 0)") unless args.nil? or args.empty?
|
42
|
+
raise ArgumentError.new("wrong number of arguments (#{args.size} for 0) to method #{m}") unless args.nil? or args.empty?
|
38
43
|
at_m = ('@' + m.to_s).to_sym
|
39
|
-
raise NoMethodError("undefined method", m) unless instance_variable_defined?(at_m)
|
44
|
+
raise NoMethodError.new("undefined method #{m}", m) unless instance_variable_defined?(at_m)
|
40
45
|
instance_variable_get(at_m)
|
41
46
|
end
|
42
47
|
|
43
|
-
#
|
44
|
-
# [
|
48
|
+
# Replaces eql?() with something more reasonable for this Class.
|
49
|
+
# @param [Object] other Object to compare self to
|
50
|
+
# @return [Boolean] true if each variable and value are the same, otherwise false.
|
45
51
|
def eql?(other)
|
46
52
|
return false if (other.nil? or self.class != other.class)
|
47
53
|
ova = other.instance_variables
|
@@ -58,11 +64,13 @@ module Ox
|
|
58
64
|
# the Ox module and is available to service wrappers that receive XML
|
59
65
|
# requests that include Objects of Classes not defined in the storage
|
60
66
|
# process.
|
61
|
-
# [
|
67
|
+
# @param [String] classname Class name or symbol that includes Module names.
|
68
|
+
# @return [Object] an instance of the specified Class.
|
69
|
+
# @raise [NameError] if the classname is invalid.
|
62
70
|
def self.define_class(classname)
|
63
71
|
classname = classname.to_s unless classname.is_a?(String)
|
64
72
|
tokens = classname.split('::').map { |n| n.to_sym }
|
65
|
-
raise "Invalid classname '#{classname}" if tokens.empty?
|
73
|
+
raise NameError.new("Invalid classname '#{classname}") if tokens.empty?
|
66
74
|
m = Object
|
67
75
|
tokens[0..-2].each do |sym|
|
68
76
|
if m.const_defined?(sym)
|
@@ -84,5 +92,4 @@ module Ox
|
|
84
92
|
end
|
85
93
|
|
86
94
|
end # Bag
|
87
|
-
|
88
95
|
end # Ox
|
data/lib/ox/cdata.rb
CHANGED
data/lib/ox/comment.rb
CHANGED
data/lib/ox/doctype.rb
CHANGED
data/lib/ox/document.rb
CHANGED
@@ -4,10 +4,10 @@ module Ox
|
|
4
4
|
# the XML prolog. A Document includes Elements.
|
5
5
|
class Document < Element
|
6
6
|
# Create a new Document.
|
7
|
-
# [
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
7
|
+
# @param [Hash] prolog prolog attributes
|
8
|
+
# @option prolog [String] :version version, typically '1.0' or '1.1'
|
9
|
+
# @option prolog [String] :encoding encoding for the document, currently included but ignored
|
10
|
+
# @option prolog [String] :standalone indicates the document is standalone
|
11
11
|
def initialize(prolog={})
|
12
12
|
super(nil)
|
13
13
|
@attributes = { }
|
data/lib/ox/element.rb
CHANGED
@@ -5,24 +5,24 @@ module Ox
|
|
5
5
|
class Element < Node
|
6
6
|
|
7
7
|
# Creates a new Element with the specified name.
|
8
|
-
# [
|
8
|
+
# @param [String] name name of the Element
|
9
9
|
def initialize(name)
|
10
10
|
super
|
11
11
|
@attributes = nil
|
12
12
|
@nodes = nil
|
13
13
|
end
|
14
|
-
|
15
14
|
alias name value
|
16
15
|
|
17
16
|
# Returns the Element's nodes array. These are the sub-elements of this
|
18
17
|
# Element.
|
18
|
+
# @return [Array] all child Nodes.
|
19
19
|
def nodes
|
20
20
|
@nodes = [] if !instance_variable_defined?(:@nodes) or @nodes.nil?
|
21
21
|
@nodes
|
22
22
|
end
|
23
23
|
|
24
24
|
# Appends a Node to the Element's nodes array.
|
25
|
-
# [
|
25
|
+
# @param [Node] node Node to append to the nodes array
|
26
26
|
def <<(node)
|
27
27
|
@nodes = [] if !instance_variable_defined?(:@nodes) or @nodes.nil?
|
28
28
|
raise "argument to << must be a String or Ox::Node." unless node.is_a?(String) or node.is_a?(Node)
|
@@ -30,21 +30,22 @@ module Ox
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# Returns all the attributes of the Element as a Hash.
|
33
|
+
# @return [Hash] all attributes and attribute values.
|
33
34
|
def attributes
|
34
35
|
@attributes = { } if !instance_variable_defined?(:@attributes) or @attributes.nil?
|
35
36
|
@attributes
|
36
37
|
end
|
37
38
|
|
38
39
|
# Returns the value of an attribute.
|
39
|
-
# [attr
|
40
|
+
# @param [Symbol|String] attr attribute name or key to return the value for
|
40
41
|
def [](attr)
|
41
42
|
return nil unless instance_variable_defined?(:@attributes) and @attributes.is_a?(Hash)
|
42
43
|
@attributes[attr] or (attr.is_a?(String) ? @attributes[attr.to_sym] : @attributes[attr.to_s])
|
43
44
|
end
|
44
45
|
|
45
46
|
# Adds or set an attribute of the Element.
|
46
|
-
# [attr
|
47
|
-
# [
|
47
|
+
# @param [Symbol|String] attr attribute name or key
|
48
|
+
# @param [Object] value value for the attribute
|
48
49
|
def []=(attr, value)
|
49
50
|
raise "argument to [] must be a Symbol or a String." unless attr.is_a?(Symbol) or attr.is_a?(String)
|
50
51
|
@attributes = { } if !instance_variable_defined?(:@attributes) or @attributes.nil?
|
@@ -53,7 +54,8 @@ module Ox
|
|
53
54
|
|
54
55
|
# Returns true if this Object and other are of the same type and have the
|
55
56
|
# equivalent value and the equivalent elements otherwise false is returned.
|
56
|
-
# [
|
57
|
+
# @param [Object] other Object compare _self_ to.
|
58
|
+
# @return [Boolean] true if both Objects are equivalent, otherwise false.
|
57
59
|
def eql?(other)
|
58
60
|
return false if (other.nil? or self.class != other.class)
|
59
61
|
return false unless super(other)
|
data/lib/ox/node.rb
CHANGED
@@ -6,14 +6,14 @@ module Ox
|
|
6
6
|
attr_accessor :value
|
7
7
|
|
8
8
|
# Creates a new Node with the specified String value.
|
9
|
-
# [
|
9
|
+
# @param [String] value string value for the Node
|
10
10
|
def initialize(value)
|
11
11
|
@value = value.to_s
|
12
12
|
end
|
13
13
|
|
14
14
|
# Returns true if this Object and other are of the same type and have the
|
15
15
|
# equivalent value otherwise false is returned.
|
16
|
-
# [
|
16
|
+
# @param [Object] other Object to compare _self_ to.
|
17
17
|
def eql?(other)
|
18
18
|
return false if (other.nil? or self.class != other.class)
|
19
19
|
other.value == @value
|
data/lib/ox/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.2.
|
5
|
+
version: 1.2.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Peter Ohler
|
@@ -10,7 +10,8 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-08-18 00:00:00 +09:00
|
14
|
+
default_executable:
|
14
15
|
dependencies: []
|
15
16
|
|
16
17
|
description: A fast XML parser and object serializer that uses only standard C lib.
|
@@ -48,7 +49,6 @@ files:
|
|
48
49
|
- ext/ox/parse.c
|
49
50
|
- test/bug1.rb
|
50
51
|
- test/bug2.rb
|
51
|
-
- test/bug3.rb
|
52
52
|
- test/cache16_test.rb
|
53
53
|
- test/cache8_test.rb
|
54
54
|
- test/cache_test.rb
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- test/Sample.graffle
|
79
79
|
- LICENSE
|
80
80
|
- README.rdoc
|
81
|
+
has_rdoc: true
|
81
82
|
homepage: https://github.com/ohler55/ox
|
82
83
|
licenses: []
|
83
84
|
|
@@ -103,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
104
|
requirements: []
|
104
105
|
|
105
106
|
rubyforge_project: ox
|
106
|
-
rubygems_version: 1.
|
107
|
+
rubygems_version: 1.6.2
|
107
108
|
signing_key:
|
108
109
|
specification_version: 3
|
109
110
|
summary: A fast XML parser and object serializer.
|
data/test/bug3.rb
DELETED
@@ -1,23 +0,0 @@
|
|
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()
|