ox 2.14.14 → 2.14.15
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/ext/ox/attr.h +33 -39
- data/ext/ox/base64.c +48 -42
- data/ext/ox/base64.h +4 -4
- data/ext/ox/buf.h +80 -86
- data/ext/ox/builder.c +378 -423
- data/ext/ox/cache.c +2 -2
- data/ext/ox/cache8.c +37 -40
- data/ext/ox/cache8.h +7 -7
- data/ext/ox/dump.c +838 -867
- data/ext/ox/err.c +16 -13
- data/ext/ox/err.h +11 -12
- data/ext/ox/extconf.rb +5 -5
- data/ext/ox/gen_load.c +135 -137
- data/ext/ox/hash_load.c +130 -148
- data/ext/ox/helper.h +32 -39
- data/ext/ox/intern.c +1 -2
- data/ext/ox/obj_load.c +590 -644
- data/ext/ox/ox.c +2 -2
- data/ext/ox/ox.h +5 -5
- data/ext/ox/parse.c +836 -874
- data/ext/ox/sax.c +38 -23
- data/ext/ox/sax.h +2 -2
- data/ext/ox/sax_as.c +78 -94
- data/ext/ox/sax_buf.c +85 -94
- data/ext/ox/sax_buf.h +101 -120
- data/ext/ox/sax_hint.c +175 -184
- data/ext/ox/sax_hint.h +19 -19
- data/ext/ox/sax_stack.h +59 -45
- data/ext/ox/slotcache.c +2 -2
- data/ext/ox/slotcache.h +4 -4
- data/ext/ox/special.c +320 -327
- data/ext/ox/special.h +2 -2
- data/ext/ox/type.h +19 -19
- data/lib/ox/bag.rb +13 -9
- data/lib/ox/cdata.rb +0 -2
- data/lib/ox/comment.rb +0 -2
- data/lib/ox/doctype.rb +0 -2
- data/lib/ox/document.rb +3 -5
- data/lib/ox/element.rb +41 -26
- data/lib/ox/error.rb +0 -3
- data/lib/ox/hasattrs.rb +7 -8
- data/lib/ox/instruct.rb +4 -6
- data/lib/ox/node.rb +3 -4
- data/lib/ox/raw.rb +0 -2
- data/lib/ox/sax.rb +20 -36
- data/lib/ox/version.rb +1 -2
- data/lib/ox/xmlrpc_adapter.rb +4 -6
- data/lib/ox.rb +15 -16
- metadata +6 -5
data/lib/ox/xmlrpc_adapter.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
1
|
require 'ox'
|
3
2
|
|
4
3
|
module Ox
|
5
|
-
|
6
4
|
# This is an alternative parser for the stdlib xmlrpc library. It makes
|
7
5
|
# use of Ox and is based on REXMLStreamParser. To use it set is as the
|
8
6
|
# parser for an XMLRPC client:
|
@@ -21,13 +19,13 @@ module Ox
|
|
21
19
|
class OxParser < Ox::Sax
|
22
20
|
include XMLRPC::XMLParser::StreamParserMixin
|
23
21
|
|
24
|
-
alias
|
25
|
-
alias
|
26
|
-
alias
|
22
|
+
alias text character
|
23
|
+
alias end_element endElement
|
24
|
+
alias start_element startElement
|
27
25
|
|
28
26
|
# Initiates the sax parser with the provided string.
|
29
27
|
def parse(str)
|
30
|
-
Ox.sax_parse(self, StringIO.new(str), :
|
28
|
+
Ox.sax_parse(self, StringIO.new(str), symbolize: false, convert_special: true)
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
data/lib/ox.rb
CHANGED
@@ -3,63 +3,62 @@
|
|
3
3
|
|
4
4
|
#
|
5
5
|
# === Description:
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# Ox handles XML documents in two ways. It is a generic XML parser and writer as
|
8
8
|
# well as a fast Object / XML marshaller. Ox was written for speed as a
|
9
9
|
# replacement for Nokogiri and for Marshal.
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# As an XML parser it is 2 or more times faster than Nokogiri and as a generic
|
12
12
|
# XML writer it is 14 times faster than Nokogiri. Of course different files may
|
13
13
|
# result in slightly different times.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# As an Object serializer Ox is 4 times faster than the standard Ruby
|
16
16
|
# Marshal.dump(). Ox is 3 times faster than Marshal.load().
|
17
|
-
#
|
17
|
+
#
|
18
18
|
# === Object Dump Sample:
|
19
|
-
#
|
19
|
+
#
|
20
20
|
# require 'ox'
|
21
|
-
#
|
21
|
+
#
|
22
22
|
# class Sample
|
23
23
|
# attr_accessor :a, :b, :c
|
24
|
-
#
|
24
|
+
#
|
25
25
|
# def initialize(a, b, c)
|
26
26
|
# @a = a
|
27
27
|
# @b = b
|
28
28
|
# @c = c
|
29
29
|
# end
|
30
30
|
# end
|
31
|
-
#
|
31
|
+
#
|
32
32
|
# # Create Object
|
33
33
|
# obj = Sample.new(1, "bee", ['x', :y, 7.0])
|
34
34
|
# # Now dump the Object to an XML String.
|
35
35
|
# xml = Ox.dump(obj)
|
36
36
|
# # Convert the object back into a Sample Object.
|
37
37
|
# obj2 = Ox.parse_obj(xml)
|
38
|
-
#
|
38
|
+
#
|
39
39
|
# === Generic XML Writing and Parsing:
|
40
|
-
#
|
40
|
+
#
|
41
41
|
# require 'ox'
|
42
|
-
#
|
42
|
+
#
|
43
43
|
# doc = Ox::Document.new(:version => '1.0')
|
44
|
-
#
|
44
|
+
#
|
45
45
|
# top = Ox::Element.new('top')
|
46
46
|
# top[:name] = 'sample'
|
47
47
|
# doc << top
|
48
|
-
#
|
48
|
+
#
|
49
49
|
# mid = Ox::Element.new('middle')
|
50
50
|
# mid[:name] = 'second'
|
51
51
|
# top << mid
|
52
|
-
#
|
52
|
+
#
|
53
53
|
# bot = Ox::Element.new('bottom')
|
54
54
|
# bot[:name] = 'third'
|
55
55
|
# mid << bot
|
56
|
-
#
|
56
|
+
#
|
57
57
|
# xml = Ox.dump(doc)
|
58
58
|
# puts xml
|
59
59
|
# doc2 = Ox.parse(xml)
|
60
60
|
# puts "Same? #{doc == doc2}"
|
61
61
|
module Ox
|
62
|
-
|
63
62
|
end
|
64
63
|
|
65
64
|
require 'ox/version'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.14.
|
4
|
+
version: 2.14.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "A fast XML parser and object serializer that uses only standard C lib.\n\nOptimized
|
14
14
|
XML (Ox), as the name implies was written to provide speed optimized\nXML handling.
|
@@ -78,7 +78,8 @@ files:
|
|
78
78
|
homepage: http://www.ohler.com/ox
|
79
79
|
licenses:
|
80
80
|
- MIT
|
81
|
-
metadata:
|
81
|
+
metadata:
|
82
|
+
rubygems_mfa_required: 'true'
|
82
83
|
post_install_message:
|
83
84
|
rdoc_options:
|
84
85
|
- "--main"
|
@@ -97,14 +98,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
97
98
|
requirements:
|
98
99
|
- - ">="
|
99
100
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
101
|
+
version: 2.7.0
|
101
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
103
|
requirements:
|
103
104
|
- - ">="
|
104
105
|
- !ruby/object:Gem::Version
|
105
106
|
version: '0'
|
106
107
|
requirements: []
|
107
|
-
rubygems_version: 3.
|
108
|
+
rubygems_version: 3.4.1
|
108
109
|
signing_key:
|
109
110
|
specification_version: 4
|
110
111
|
summary: A fast XML parser and object serializer.
|