multisax 0.0.6.1 → 0.0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -9
- data/CHANGELOG.md +6 -0
- data/README.md +2 -0
- data/Xerces.md +5 -2
- data/lib/multisax.rb +5 -3
- data/spec/multisax_spec.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d9cde8ca1531821ca8d5fef360f4539ec013ca
|
4
|
+
data.tar.gz: 0936ab0b24531ba880509047ca42ab92103fd0b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87d7286007f7b8b836aa4560281e6f10f77bbdee64ffd964ffeca222ff708ebfc040bc2aa94c140518fd7fdda86d3e6fb574435546e63cf628bdab5064cad050
|
7
|
+
data.tar.gz: 3c8d03717ea0be24834774d5b9c1c29110330c29b9c32b9d9c7b474604e3b8b2e1908a0bbcba7b04fc76f62dd2bf25f87bad5fcf53757d54013c087b5e2f70b2
|
data/.travis.yml
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
language: ruby
|
2
|
-
before_install:
|
3
|
-
- gem update --system 2.1.11
|
4
|
-
- gem --version
|
5
2
|
rvm:
|
6
3
|
- 1.8.7
|
7
4
|
- ree
|
@@ -9,16 +6,16 @@ rvm:
|
|
9
6
|
- 1.9.3
|
10
7
|
- 2.0.0
|
11
8
|
- 2.1.0
|
12
|
-
- 2.1.
|
13
|
-
- 2.
|
9
|
+
- 2.1.7
|
10
|
+
- 2.2.0
|
11
|
+
- 2.2.3
|
14
12
|
- ruby-head
|
15
13
|
- jruby-18mode
|
16
14
|
- jruby-19mode
|
17
15
|
- jruby-20mode
|
18
16
|
- jruby-21mode
|
19
17
|
- jruby-head
|
20
|
-
- rbx-2
|
21
|
-
- rbx-2.2.3
|
18
|
+
- rbx-2
|
22
19
|
matrix:
|
23
20
|
allow_failures:
|
24
21
|
- rvm: ruby-head
|
@@ -27,5 +24,4 @@ matrix:
|
|
27
24
|
- rvm: jruby-19mode
|
28
25
|
- rvm: jruby-20mode
|
29
26
|
- rvm: jruby-21mode
|
30
|
-
- rvm: rbx-2
|
31
|
-
- rvm: rbx-2.2.3
|
27
|
+
- rvm: rbx-2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,8 @@ A module which allows multiple SAX library transparently.
|
|
3
3
|
|
4
4
|
[![Build Status](https://travis-ci.org/cielavenir/multisax.png)](https://travis-ci.org/cielavenir/multisax) [![Code Climate](https://codeclimate.com/github/cielavenir/multisax.png)](https://codeclimate.com/github/cielavenir/multisax) [![Coverage Status](https://coveralls.io/repos/cielavenir/multisax/badge.png)](https://coveralls.io/r/cielavenir/multisax)
|
5
5
|
|
6
|
+
[Why the coverage is so low?](Xerces.md)
|
7
|
+
|
6
8
|
## Supported Ruby versions
|
7
9
|
* Ruby 1.8.7 or later
|
8
10
|
* jruby
|
data/Xerces.md
CHANGED
@@ -13,7 +13,8 @@ Here is the instruction to activate Xerces-Ruby.
|
|
13
13
|
- Download and extract [xerces-ruby](http://www.geocities.co.jp/SiliconValley-SanJose/9156/xerces-ruby.html)
|
14
14
|
- Download [xerces-ruby.patch](https://gist.github.com/cielavenir/8401975)
|
15
15
|
- Convert SAXParse.cpp's charcode
|
16
|
-
- `
|
16
|
+
- `cd /path/to/xerces-ruby/`
|
17
|
+
- `nkf -i -w SAXParse.cpp`
|
17
18
|
- Apply patch
|
18
19
|
- `patch < xerces-ruby.patch`
|
19
20
|
- Run extconf.rb
|
@@ -24,4 +25,6 @@ Here is the instruction to activate Xerces-Ruby.
|
|
24
25
|
- `sudo cp Xerces.rb /Library/Ruby/Site/2.0.0/`
|
25
26
|
- Now you can `require 'Xerces'` in your Ruby script.
|
26
27
|
|
27
|
-
- Please note currently Xerces-Ruby cannot
|
28
|
+
- Please note currently Xerces-Ruby cannot distinguish cdata and text, so both sax_cdata and sax_text are called. I (ciel) am NOT going to fix it.
|
29
|
+
|
30
|
+
- coverall.io includes :nocov: region as missing, resulting in low coverage, meh...
|
data/lib/multisax.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
module MultiSAX
|
10
10
|
# VERSION string
|
11
|
-
VERSION='0.0.
|
11
|
+
VERSION='0.0.7.1'
|
12
12
|
|
13
13
|
# Default XML parsers
|
14
14
|
XML_PARSERS_DEFAULT=[:rexmlstream,:rexmlsax2]
|
@@ -167,7 +167,7 @@ module MultiSAX
|
|
167
167
|
end
|
168
168
|
def on_element(ns,tag,attrs)
|
169
169
|
tag_name=(ns ? (ns+':') : '')+tag
|
170
|
-
@obj.sax_tag_start(tag_name,Hash[*attrs.
|
170
|
+
@obj.sax_tag_start(tag_name,Hash[*attrs.flatten(1)])
|
171
171
|
return tag_name
|
172
172
|
end
|
173
173
|
def after_element(ns,tag)
|
@@ -178,11 +178,12 @@ module MultiSAX
|
|
178
178
|
def on_cdata(txt) @obj.sax_cdata(txt) end
|
179
179
|
def on_comment(txt) @obj.sax_comment(txt) end
|
180
180
|
def on_xml_decl(args)
|
181
|
-
attrs=Hash[*args.
|
181
|
+
attrs=Hash[*args.flatten(1)]
|
182
182
|
@obj.sax_xmldecl(attrs['version'],attrs['encoding'],attrs['standalone'])
|
183
183
|
end
|
184
184
|
}
|
185
185
|
break
|
186
|
+
# :nocov:
|
186
187
|
when :xerces
|
187
188
|
begin
|
188
189
|
require 'Xerces'
|
@@ -214,6 +215,7 @@ module MultiSAX
|
|
214
215
|
#end
|
215
216
|
}
|
216
217
|
break
|
218
|
+
# :nocov:
|
217
219
|
when :rexmlstream
|
218
220
|
begin
|
219
221
|
require 'rexml/parsers/baseparser'
|
data/spec/multisax_spec.rb
CHANGED
@@ -60,6 +60,7 @@ describe "[XML] MultiSAX::Sax.parse(String)" do
|
|
60
60
|
end
|
61
61
|
it "uses :ox" do
|
62
62
|
pending 'ox is not supported by jruby' if defined?(RUBY_ENGINE)&&RUBY_ENGINE=='jruby'
|
63
|
+
pending 'ox looks broken on Ruby <1.9' if RUBY_VERSION<'1.9' ###
|
63
64
|
MultiSAX::Sax.reset
|
64
65
|
MultiSAX::Sax.open(:ox)
|
65
66
|
MultiSAX::Sax.parser.should eq :ox
|
@@ -142,6 +143,7 @@ describe "[XML] MultiSAX::Sax.parse(IO)" do
|
|
142
143
|
end
|
143
144
|
it "uses :ox" do
|
144
145
|
pending 'ox is not supported by jruby' if defined?(RUBY_ENGINE)&&RUBY_ENGINE=='jruby'
|
146
|
+
pending 'ox looks broken on Ruby <1.9' if RUBY_VERSION<'1.9' ###
|
145
147
|
MultiSAX::Sax.reset
|
146
148
|
MultiSAX::Sax.open(:ox)
|
147
149
|
MultiSAX::Sax.parser.should eq :ox
|
@@ -218,6 +220,7 @@ html_answer=['html','head','head','body','span','hello','span','body','html']
|
|
218
220
|
describe "[HTML] MultiSAX::Sax.parse(String)" do
|
219
221
|
it "uses :oxhtml" do
|
220
222
|
pending 'ox is not supported by jruby' if defined?(RUBY_ENGINE)&&RUBY_ENGINE=='jruby'
|
223
|
+
pending 'ox looks broken on Ruby <1.9' if RUBY_VERSION<'1.9' ###
|
221
224
|
MultiSAX::Sax.reset
|
222
225
|
MultiSAX::Sax.open(:oxhtml)
|
223
226
|
MultiSAX::Sax.parser.should eq :oxhtml
|
@@ -235,7 +238,6 @@ describe "[HTML] MultiSAX::Sax.parse(String)" do
|
|
235
238
|
end
|
236
239
|
it "uses :ogahtml" do
|
237
240
|
pending 'oga requires Ruby >=1.9.3' if RUBY_VERSION<'1.9.3'
|
238
|
-
pending 'oga does not like broken HTML'
|
239
241
|
MultiSAX::Sax.reset
|
240
242
|
MultiSAX::Sax.open(:ogahtml)
|
241
243
|
MultiSAX::Sax.parser.should eq :ogahtml
|
@@ -248,6 +250,7 @@ end
|
|
248
250
|
describe "[HTML] MultiSAX::Sax.parse(IO)" do
|
249
251
|
it "uses :oxhtml" do
|
250
252
|
pending 'ox is not supported by jruby' if defined?(RUBY_ENGINE)&&RUBY_ENGINE=='jruby'
|
253
|
+
pending 'ox looks broken on Ruby <1.9' if RUBY_VERSION<'1.9' ###
|
251
254
|
MultiSAX::Sax.reset
|
252
255
|
MultiSAX::Sax.open(:oxhtml)
|
253
256
|
MultiSAX::Sax.parser.should eq :oxhtml
|
@@ -265,7 +268,6 @@ describe "[HTML] MultiSAX::Sax.parse(IO)" do
|
|
265
268
|
end
|
266
269
|
it "uses :ogahtml" do
|
267
270
|
pending 'oga requires Ruby >=1.9.3' if RUBY_VERSION<'1.9.3'
|
268
|
-
pending 'oga does not like broken HTML'
|
269
271
|
MultiSAX::Sax.reset
|
270
272
|
MultiSAX::Sax.open(:ogahtml)
|
271
273
|
MultiSAX::Sax.parser.should eq :ogahtml
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multisax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cielavenir
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|