ox 2.14.14 → 2.14.16

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:
@@ -21,13 +19,13 @@ module Ox
21
19
  class OxParser < Ox::Sax
22
20
  include XMLRPC::XMLParser::StreamParserMixin
23
21
 
24
- alias :text :character
25
- alias :end_element :endElement
26
- alias :start_element :startElement
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), :symbolize => false, :convert_special => true)
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.14
4
+ version: 2.14.16
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
11
+ date: 2023-04-12 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: '0'
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.3.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.