ox 2.14.14 → 2.14.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -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:
@@ -14,6 +12,7 @@ module Ox
14
12
  class StreamParser < XMLRPC::XMLParser::AbstractStreamParser
15
13
  # Create a new instance.
16
14
  def initialize
15
+ super
17
16
  @parser_class = OxParser
18
17
  end
19
18
 
@@ -21,13 +20,13 @@ module Ox
21
20
  class OxParser < Ox::Sax
22
21
  include XMLRPC::XMLParser::StreamParserMixin
23
22
 
24
- alias :text :character
25
- alias :end_element :endElement
26
- alias :start_element :startElement
23
+ alias text character
24
+ alias end_element endElement
25
+ alias start_element startElement
27
26
 
28
27
  # Initiates the sax parser with the provided string.
29
28
  def parse(str)
30
- Ox.sax_parse(self, StringIO.new(str), :symbolize => false, :convert_special => true)
29
+ Ox.sax_parse(self, StringIO.new(str), symbolize: false, convert_special: true)
31
30
  end
32
31
  end
33
32
  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,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.14
4
+ version: 2.14.17
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-01-27 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2023-07-14 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: '1.2'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.2'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
13
33
  description: "A fast XML parser and object serializer that uses only standard C lib.\n\nOptimized
14
34
  XML (Ox), as the name implies was written to provide speed optimized\nXML handling.
15
35
  It was designed to be an alternative to Nokogiri and other Ruby\nXML parsers for
@@ -78,7 +98,8 @@ files:
78
98
  homepage: http://www.ohler.com/ox
79
99
  licenses:
80
100
  - MIT
81
- metadata: {}
101
+ metadata:
102
+ rubygems_mfa_required: 'true'
82
103
  post_install_message:
83
104
  rdoc_options:
84
105
  - "--main"
@@ -97,14 +118,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
118
  requirements:
98
119
  - - ">="
99
120
  - !ruby/object:Gem::Version
100
- version: '0'
121
+ version: 2.7.0
101
122
  required_rubygems_version: !ruby/object:Gem::Requirement
102
123
  requirements:
103
124
  - - ">="
104
125
  - !ruby/object:Gem::Version
105
126
  version: '0'
106
127
  requirements: []
107
- rubygems_version: 3.3.3
128
+ rubygems_version: 3.4.1
108
129
  signing_key:
109
130
  specification_version: 4
110
131
  summary: A fast XML parser and object serializer.