xml_node_stream 1.0.2 → 2.0.0
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 +7 -0
- data/CHANGELOG.md +30 -0
- data/README.md +139 -0
- data/VERSION +1 -0
- data/lib/xml_node_stream/http_stream.rb +179 -0
- data/lib/xml_node_stream/node.rb +98 -47
- data/lib/xml_node_stream/parser/base.rb +49 -12
- data/lib/xml_node_stream/parser/libxml_parser.rb +36 -9
- data/lib/xml_node_stream/parser/nokogiri_parser.rb +42 -12
- data/lib/xml_node_stream/parser/rexml_parser.rb +35 -8
- data/lib/xml_node_stream/parser.rb +54 -29
- data/lib/xml_node_stream/selector.rb +144 -34
- data/lib/xml_node_stream.rb +18 -5
- data/xml_node_stream.gemspec +39 -0
- metadata +46 -88
- data/README.rdoc +0 -61
- data/Rakefile +0 -44
- data/spec/node_spec.rb +0 -140
- data/spec/parser_spec.rb +0 -148
- data/spec/selector_spec.rb +0 -73
- data/spec/spec_helper.rb +0 -2
- data/spec/test.xml +0 -57
- data/spec/xml_node_stream_spec.rb +0 -11
- /data/{MIT_LICENSE → MIT-LICENSE} +0 -0
data/spec/test.xml
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0"?>
|
|
2
|
-
<library>
|
|
3
|
-
<?library-info version="2.0" ignore="yes" ?>
|
|
4
|
-
<!-- Authors -->
|
|
5
|
-
<authors>
|
|
6
|
-
<author id="1">
|
|
7
|
-
<name>Edward Gibbon</name>
|
|
8
|
-
</author>
|
|
9
|
-
<author id="2">
|
|
10
|
-
<name>Herman Melville</name>
|
|
11
|
-
</author>
|
|
12
|
-
<author id="3">
|
|
13
|
-
<name>Jack London</name>
|
|
14
|
-
</author>
|
|
15
|
-
</authors>
|
|
16
|
-
<!-- Books -->
|
|
17
|
-
<collection>
|
|
18
|
-
<section id="100" name="History">
|
|
19
|
-
<book id="1">
|
|
20
|
-
<title>
|
|
21
|
-
The Decline & Fall of the Roman Empire
|
|
22
|
-
</title>
|
|
23
|
-
<author id="1"/>
|
|
24
|
-
<abstract><![CDATA[History of the fall of Rome.]]></abstract>
|
|
25
|
-
<volumes>6</volumes>
|
|
26
|
-
</book>
|
|
27
|
-
</section>
|
|
28
|
-
<section id="200" name="Fiction">
|
|
29
|
-
<book id="2">
|
|
30
|
-
<title>
|
|
31
|
-
Call of the Wild
|
|
32
|
-
</title>
|
|
33
|
-
<author id="3"/>
|
|
34
|
-
<abstract><![CDATA[
|
|
35
|
-
A dog goes to Alaska.
|
|
36
|
-
]]></abstract>
|
|
37
|
-
</book>
|
|
38
|
-
<book id="3">
|
|
39
|
-
<title>
|
|
40
|
-
White Fang
|
|
41
|
-
</title>
|
|
42
|
-
<author id="3"/>
|
|
43
|
-
<abstract><![CDATA[Dogs, wolves, etc.]]></abstract>
|
|
44
|
-
</book>
|
|
45
|
-
<book id="4">
|
|
46
|
-
<title>
|
|
47
|
-
Moby Dick
|
|
48
|
-
</title>
|
|
49
|
-
<alternate_title>
|
|
50
|
-
The Whale
|
|
51
|
-
</alternate_title>
|
|
52
|
-
<author id="2"/>
|
|
53
|
-
<abstract><![CDATA[A mad captain seeks a mysterious white whale.]]></abstract>
|
|
54
|
-
</book>
|
|
55
|
-
</section>
|
|
56
|
-
</collection>
|
|
57
|
-
</library>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
|
|
2
|
-
|
|
3
|
-
describe XmlNodeStream do
|
|
4
|
-
|
|
5
|
-
it "should parse a document using the Parser.parse method" do
|
|
6
|
-
block = lambda{}
|
|
7
|
-
XmlNodeStream::Parser.should_receive(:parse).with("<xml/>", &block)
|
|
8
|
-
XmlNodeStream.parse("<xml/>", &block)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
end
|
|
File without changes
|