multisax 0.0.0.4 → 0.0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/multisax.rb +5 -5
- data/multisax.gemspec +3 -3
- data/spec/multisax_spec.rb +4 -0
- metadata +4 -4
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -16,7 +16,7 @@ Jeweler::Tasks.new do |gem|
|
|
16
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
17
|
gem.name = 'multisax'
|
18
18
|
gem.homepage = 'http://github.com/cielavenir/multisax'
|
19
|
-
gem.license = '2-clause BSDL'
|
19
|
+
gem.license = 'Ruby License (2-clause BSDL or Artistic)'
|
20
20
|
gem.summary = 'Ruby Gem to handle multiple SAX libraries'
|
21
21
|
gem.description = 'Ruby Gem to handle multiple SAX libraries: ox/libxml/nokogiri/rexml'
|
22
22
|
gem.email = 'cielartisan@gmail.com'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.0.
|
1
|
+
0.0.0.5
|
data/lib/multisax.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MultiSAX: Ruby Gem to handle multiple SAX libraries
|
2
2
|
#
|
3
|
-
# Copyright (c) 2013, T. Yamada
|
3
|
+
# Copyright (c) 2013, T. Yamada under Ruby License (2-clause BSDL or Artistic).
|
4
4
|
#
|
5
5
|
# Check LICENSE terms.
|
6
6
|
#
|
@@ -27,7 +27,7 @@ module MultiSAX
|
|
27
27
|
when :ox
|
28
28
|
begin
|
29
29
|
require 'ox'
|
30
|
-
require 'stringio' #this should be
|
30
|
+
require 'stringio' #this should be standard module.
|
31
31
|
rescue LoadError;next end
|
32
32
|
@@parser=e_module
|
33
33
|
methods=Ox::Sax.private_instance_methods(false)-Class.private_instance_methods(false)
|
@@ -78,15 +78,16 @@ module MultiSAX
|
|
78
78
|
#--
|
79
79
|
#def initialize(listener)
|
80
80
|
#++
|
81
|
+
|
81
82
|
# The main parsing method.
|
82
83
|
# Listener can be Class.new{include MultiSAX::Callbacks}.new. Returns the listener after SAX is applied.
|
83
|
-
# If you have not called open(), this will call it using default value (all libraries).
|
84
|
+
# If you have not called open(), this will call it using default value (all libraries).
|
84
85
|
# SAX's listeners are usually modified destructively.
|
85
86
|
# So instances shouldn't be provided.
|
86
87
|
def self.parse(body,listener)
|
87
88
|
#self.class.open if !@@parser
|
88
89
|
self.open if !@@parser
|
89
|
-
raise "Failed to open SAX library. REXML, which is
|
90
|
+
raise "Failed to open SAX library. REXML, which is a standard Ruby module, might be also corrupted." if !@@parser
|
90
91
|
@listener=listener
|
91
92
|
|
92
93
|
#Here comes method mapping.
|
@@ -187,7 +188,6 @@ module MultiSAX
|
|
187
188
|
end
|
188
189
|
end
|
189
190
|
|
190
|
-
##
|
191
191
|
# MultiSAX callbacks.
|
192
192
|
# MultiSAX::Sax listener should include this module.
|
193
193
|
module Callbacks
|
data/multisax.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "multisax"
|
8
|
-
s.version = "0.0.0.
|
8
|
+
s.version = "0.0.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["cielavenir"]
|
12
|
-
s.date = "2013-06-
|
12
|
+
s.date = "2013-06-21"
|
13
13
|
s.description = "Ruby Gem to handle multiple SAX libraries: ox/libxml/nokogiri/rexml"
|
14
14
|
s.email = "cielartisan@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
"spec/spec_helper.rb"
|
32
32
|
]
|
33
33
|
s.homepage = "http://github.com/cielavenir/multisax"
|
34
|
-
s.licenses = ["2-clause BSDL"]
|
34
|
+
s.licenses = ["Ruby License (2-clause BSDL or Artistic)"]
|
35
35
|
s.require_paths = ["lib"]
|
36
36
|
s.rubygems_version = "1.8.25"
|
37
37
|
s.summary = "Ruby Gem to handle multiple SAX libraries"
|
data/spec/multisax_spec.rb
CHANGED
@@ -26,6 +26,10 @@ EOM
|
|
26
26
|
answer=['hello','sax','world','sax','hello']
|
27
27
|
|
28
28
|
describe "Multisax" do
|
29
|
+
it "unknown" do
|
30
|
+
MultiSAX::Sax.reset
|
31
|
+
MultiSAX::Sax.open(:unknown).should be_false
|
32
|
+
end
|
29
33
|
it "rexmlstream" do
|
30
34
|
MultiSAX::Sax.reset
|
31
35
|
MultiSAX::Sax.open(:rexmlstream)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multisax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -97,7 +97,7 @@ files:
|
|
97
97
|
- spec/spec_helper.rb
|
98
98
|
homepage: http://github.com/cielavenir/multisax
|
99
99
|
licenses:
|
100
|
-
- 2-clause BSDL
|
100
|
+
- Ruby License (2-clause BSDL or Artistic)
|
101
101
|
post_install_message:
|
102
102
|
rdoc_options: []
|
103
103
|
require_paths:
|
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
segments:
|
112
112
|
- 0
|
113
|
-
hash:
|
113
|
+
hash: -417005702890450070
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
115
|
none: false
|
116
116
|
requirements:
|