libxml-ruby 0.9.3-x86-mswin32-60 → 0.9.4-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +9 -0
- data/README +61 -128
- data/doc/css/normal.css +182 -0
- data/doc/img/raze-tiny.png +0 -0
- data/doc/img/red-cube.jpg +0 -0
- data/doc/img/xml-ruby.png +0 -0
- data/doc/index.xml +43 -0
- data/doc/install.xml +77 -0
- data/doc/layout.rhtml +38 -0
- data/doc/layout.xsl +67 -0
- data/doc/license.xml +32 -0
- data/doc/log/changelog.xml +1324 -0
- data/doc/log/changelog.xsl +42 -0
- data/ext/libxml/ruby_xml_document.c +1084 -1057
- data/ext/libxml/ruby_xml_html_parser.c +37 -40
- data/ext/libxml/ruby_xml_input.c +17 -40
- data/ext/libxml/ruby_xml_input.h +2 -2
- data/ext/libxml/ruby_xml_parser.c +151 -151
- data/ext/libxml/ruby_xml_reader.c +910 -893
- data/ext/libxml/ruby_xml_sax_parser.c +174 -174
- data/ext/libxml/ruby_xml_sax_parser.h +12 -12
- data/ext/libxml/ruby_xml_xpointer.h +13 -25
- data/ext/libxml/version.h +2 -2
- data/ext/mingw/libxml_ruby.dll.a +0 -0
- data/ext/mingw/libxml_ruby.so +0 -0
- data/ext/vc/libxml_ruby.vcproj +1 -1
- data/test/model/ruby-lang.html +238 -0
- data/test/tc_html_parser.rb +2 -12
- data/test/tc_reader.rb +87 -87
- metadata +17 -3
- data/test/test.rb +0 -8
@@ -0,0 +1,238 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
4
|
+
<head>
|
5
|
+
<title>Ruby Programming Language</title>
|
6
|
+
<link rel="stylesheet" type="text/css" href="/stylesheets/low.css" />
|
7
|
+
<link rel="stylesheet" type="text/css" href="/stylesheets/screen.css" media="screen" />
|
8
|
+
<link rel="stylesheet" type="text/css" href="/stylesheets/print.css" media="print" />
|
9
|
+
<link title="Low vision" rel="alternate stylesheet" type="text/css" href="/stylesheets/low_vision_screen.css" media="screen" />
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
|
11
|
+
<link href="/en/feeds/news.rss" rel="alternate" title="RSS" type="application/rss+xml" />
|
12
|
+
|
13
|
+
</head>
|
14
|
+
<body id="home-page-layout">
|
15
|
+
<div id="page">
|
16
|
+
<div id="header">
|
17
|
+
<div id="logo"><img src="/images/logo.gif" width="331" height="119" alt="Ruby - A Programmer's Best Friend" title="" /></div>
|
18
|
+
<div class="site-links">
|
19
|
+
<a href="/en/downloads/">Downloads</a><span class="separator"> | </span><a href="/en/documentation/">Documentation</a><span class="separator"> | </span><a href="/en/libraries/">Libraries</a><span class="separator"> | </span><a href="/en/community/">Community</a><span class="separator"> | </span><a href="/en/news/">News</a><span class="separator"> | </span><a href="/en/security/">Security</a><span class="separator"> | </span><a href="/en/about/">About Ruby</a>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
<hr class="hidden-modern" />
|
23
|
+
<div id="main-wrapper">
|
24
|
+
<div id="main">
|
25
|
+
<div id="content-wrapper">
|
26
|
+
<div id="head-wrapper-1">
|
27
|
+
<div id="head-wrapper-2">
|
28
|
+
<div id="head">
|
29
|
+
|
30
|
+
<div id="intro">
|
31
|
+
<h1>Ruby is…</h1>
|
32
|
+
<p>A dynamic, open source programming language with a focus on
|
33
|
+
simplicity and productivity. It has an elegant syntax that is
|
34
|
+
natural to read and easy to write.</p>
|
35
|
+
<p><a href="about/">Read More…</a></p>
|
36
|
+
</div>
|
37
|
+
<div id="code">
|
38
|
+
|
39
|
+
<div class="comment"># The Greeter class</div>
|
40
|
+
<div><span class="keyword">class</span> Greeter</div>
|
41
|
+
<div> <span class="keyword">def</span> initialize<span class="op">(</span>name<span class="op">)</span></div>
|
42
|
+
<div> @name <span class="op">=</span> name<span class="op">.</span>capitalize</div>
|
43
|
+
<div> <span class="keyword">end</span></div>
|
44
|
+
<div class="blank-line"> </div>
|
45
|
+
<div> <span class="keyword">def</span> salute</div>
|
46
|
+
<div> puts <span class="string">"Hello #{</span><span class="op">@</span>name<span class="string">}!"</span></div>
|
47
|
+
<div> <span class="keyword">end</span></div>
|
48
|
+
<div><span class="keyword">end</span></div>
|
49
|
+
<div class="blank-line"> </div>
|
50
|
+
<div class="comment"># Create a new object</div>
|
51
|
+
<div>g <span class="op">=</span> Greeter<span class="op">.</span>new<span class="op">(</span><span class="string">"world"</span><span class="op">)</span></div>
|
52
|
+
<div class="blank-line"> </div>
|
53
|
+
<div class="comment"># Output "Hello World!"</div>
|
54
|
+
<div>g<span class="op">.</span>salute</div>
|
55
|
+
|
56
|
+
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
<div id="content">
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
<div class="post">
|
67
|
+
<h3><a href="/en/news/2008/11/10/scotland-on-rails-2009/">Scotland on Rails 2009</a></h3>
|
68
|
+
|
69
|
+
<p><a href="http://scotlandonrails.com">Scotland on Rails</a> is pleased to announce that Conference2009 will be held March 26-28 in Edinburgh, Scotland.</p>
|
70
|
+
|
71
|
+
|
72
|
+
<p>We are now accepting submissions. The closing date for submissions is December 1st 2008, so there’s still time! Please mail your plaintext proposals for 45 minute sessions to <a href="mailto:submissions@scotlandonrails.com">submissions@scotlandonrails.com</a>.</p>
|
73
|
+
|
74
|
+
|
75
|
+
<p>Alternatively, if you are interested in sponsoring the conference, please mail <a href="mailto:sponsorship@scotlandonrails.com">sponsorship@scotlandonrails.com</a> for a prospectus.</p>
|
76
|
+
|
77
|
+
|
78
|
+
<p>Lastly, if you wish to be notified when we open for registration, you can sign up on the site.</p>
|
79
|
+
|
80
|
+
|
81
|
+
<p>Come and enjoy all that Edinburgh has to offer (whisky! castle! volcano! ruby! whisky!) in March. We hope to see you there.</p>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<p class="post-info">Posted by James Edward Gray II on 10 Nov 2008</p>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
<div class="post">
|
90
|
+
<h3><a href="/en/news/2008/11/08/mountainwest-rubyconf-2009-dates-and-cfp/">MountainWest RubyConf 2009 dates and CFP</a></h3>
|
91
|
+
|
92
|
+
<p><a href="http://mtnwestrubyconf.org">MountainWest RubyConf 2009</a> will be held March 13-14, 2009, in Salt Lake City, Utah, <span class="caps">USA</span>.</p>
|
93
|
+
|
94
|
+
|
95
|
+
<p>Proposals to speak at this regional conference are now being accepted. Please send your proposal to proposals@mtnwestrubyconf.org.</p>
|
96
|
+
|
97
|
+
|
98
|
+
<p>The submission deadline is midnight (MST) on December 31st, 2008.</p>
|
99
|
+
|
100
|
+
|
101
|
+
<p>There are sponsorship opportunities available as well. Please contact sponsorship@mtnwestruby.org if you are interested.</p>
|
102
|
+
|
103
|
+
|
104
|
+
<p>Please see <a href="http://mtnwestrubyconf.org">mtnwestrubyconf.org/</a> for more details as they become available.</p>
|
105
|
+
|
106
|
+
<p><a href="/en/news/2008/11/08/mountainwest-rubyconf-2009-dates-and-cfp/">Continue Reading…</a></p>
|
107
|
+
|
108
|
+
<p class="post-info">Posted by james on 08 Nov 2008</p>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<div id="news">
|
114
|
+
<h3><a href="/en/news/">Other News</a></h3>
|
115
|
+
<ul>
|
116
|
+
<li><a href="/en/news/2008/10/28/ruby-1-9-1-preview-1-released/"> Ruby 1.9.1-preview 1 released</a>
|
117
|
+
<span class="post-info">Posted by james on 28 Oct 2008</span></li>
|
118
|
+
<li><a href="/en/news/2008/10/02/rubyconf-2008-is-sold-out/">RubyConf 2008 is Sold-out</a>
|
119
|
+
<span class="post-info">Posted by james on 02 Oct 2008</span></li>
|
120
|
+
<li><a href="/en/news/2008/09/09/voices-that-matter-2008/">Voices That Matter 2008</a>
|
121
|
+
<span class="post-info">Posted by James Edward Gray II on 09 Sep 2008</span></li>
|
122
|
+
</ul>
|
123
|
+
<ul>
|
124
|
+
<li><a href="/en/news/2008/08/23/dos-vulnerability-in-rexml/">DoS vulnerability in REXML</a>
|
125
|
+
<span class="post-info">Posted by Shugo Maeda on 23 Aug 2008</span></li>
|
126
|
+
<li><a href="/en/news/2008/08/11/ruby-1-8-7-p72-and-1-8-6-p287-released/">Ruby 1.8.7-p72 and 1.8.6-p287 released</a>
|
127
|
+
<span class="post-info">Posted by Shugo Maeda on 11 Aug 2008</span></li>
|
128
|
+
<li><a href="/en/news/2008/08/08/multiple-vulnerabilities-in-ruby/">Multiple vulnerabilities in Ruby</a>
|
129
|
+
<span class="post-info">Posted by Shugo Maeda on 08 Aug 2008</span></li>
|
130
|
+
</ul>
|
131
|
+
<p class="more"><a href="/en/news/">More News…</a></p>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
<hr class="hidden-modern" />
|
140
|
+
<div id="sidebar-wrapper">
|
141
|
+
<div id="sidebar">
|
142
|
+
|
143
|
+
<div class="navigation"><a href="/en/downloads/"><img src="/images/download.gif" alt="Download Ruby" title="" /></a></div>
|
144
|
+
|
145
|
+
|
146
|
+
<div class="navigation">
|
147
|
+
<h3><strong>Get Started,</strong> it’s easy!</h3>
|
148
|
+
<ul class="menu">
|
149
|
+
<li><a href="http://tryruby.hobix.com/">Try Ruby! (in your browser)</a></li>
|
150
|
+
|
151
|
+
<li><a href="/en/documentation/quickstart/">Ruby in Twenty Minutes</a></li>
|
152
|
+
<li><a href="/en/documentation/ruby-from-other-languages/">Ruby from Other Languages</a></li>
|
153
|
+
</ul>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div class="navigation">
|
157
|
+
<h3><strong>Explore</strong> a new world…</h3>
|
158
|
+
<ul class="menu">
|
159
|
+
<li><a href="/en/documentation/">Documentation</a></li>
|
160
|
+
<li><a href="http://www.amazon.com">Books</a></li>
|
161
|
+
<li><a href="/en/libraries/">Libraries</a></li>
|
162
|
+
<li><a href="/en/documentation/success-stories/">Success Stories</a></li>
|
163
|
+
</ul>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<div class="navigation">
|
167
|
+
<h3><strong>Participate</strong> in a friendly and growing community.</h3>
|
168
|
+
<ul>
|
169
|
+
<li><a href="/en/community/mailing-lists/">Mailing Lists</a>: Talk about Ruby with programmers from all around the world.</li>
|
170
|
+
<li><a href="/en/community/user-groups/">User Groups</a>: Get in contact with Rubyists in your area.</li>
|
171
|
+
<li><a href="/en/community/weblogs/">Weblogs</a>: Read about what’s happening right now in the Ruby community.</li>
|
172
|
+
<li><a href="/en/community/ruby-core/">Ruby Core</a>: Help polish the rough edges of the latest Ruby.</li>
|
173
|
+
<li><a href="http://redmine.ruby-lang.org/">Issue Tracking</a>: Report or help solve issues in Ruby.</li>
|
174
|
+
</ul>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
|
178
|
+
<h3>Top Ruby Projects</h3>
|
179
|
+
|
180
|
+
<ul>
|
181
|
+
<li><a href="http://rubyforge.org/projects/instantrails/" title="Instant Rails is a one-stop Rails runtime solution containing Ruby, Rails, Apache, and MySQL, all pre-configured and ready to run. No installer, you simply drop it into the directory of your choice and run it. It does not modify your system environment. ">Instant Rails</a></li>
|
182
|
+
|
183
|
+
<li><a href="http://rubyforge.org/projects/ruby/" title="Main Ruby language project for providing a mirror of the Ruby releases, tracking bugs, etc.">Ruby</a></li>
|
184
|
+
|
185
|
+
<li><a href="http://rubyforge.org/projects/nitro/" title="Nitro is an efficient, yet simple engine for developing professional Web Applications using the Ruby language.">Nitro</a></li>
|
186
|
+
|
187
|
+
<li><a href="http://rubyforge.org/projects/activesupport/" title="Utility classes and extension to the standard library that were required by Rails, but found of general use.">Active Support</a></li>
|
188
|
+
|
189
|
+
<li><a href="http://rubyforge.org/projects/typo/" title="Typo is a lean weblogging engine powered by rails. It supports XMLRPC posting, ping/trackback, comments, textile, markdown, categories, all common exports, fulltext search and so on.">typo</a></li>
|
190
|
+
|
191
|
+
</ul>
|
192
|
+
<p class="more"><a href="/en/libraries/top-projects/">More…</a></p>
|
193
|
+
|
194
|
+
|
195
|
+
<h3>Syndicate</h3>
|
196
|
+
<p><a href="/en/feeds/news.rss">Recent News (RSS)</a></p>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
<hr class="hidden-modern" />
|
200
|
+
<div class="foot">
|
201
|
+
<div class="site-links">
|
202
|
+
<a href="/en/downloads/">Downloads</a><span class="separator"> | </span><a href="/en/documentation/">Documentation</a><span class="separator"> | </span><a href="/en/libraries/">Libraries</a><span class="separator"> | </span><a href="/en/community/">Community</a><span class="separator"> | </span><a href="/en/news/">News</a><span class="separator"> | </span><a href="/en/security/">Security</a><span class="separator"> | </span><a href="/en/about/">About Ruby</a>
|
203
|
+
</div>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
<div id="search-box">
|
208
|
+
<form id="search-form" action="/en/search/">
|
209
|
+
<table class="fieldset">
|
210
|
+
<tr>
|
211
|
+
<td>
|
212
|
+
<input class="field" type="text" name="q" />
|
213
|
+
</td>
|
214
|
+
<td>
|
215
|
+
<input class="button" type="submit" value="Search" />
|
216
|
+
</td>
|
217
|
+
</tr>
|
218
|
+
</table>
|
219
|
+
</form>
|
220
|
+
</div>
|
221
|
+
<div id="footer">
|
222
|
+
<div class="fine-print">
|
223
|
+
<p>Content available in <a href="/en/">English</a>, <a href="/fr/">French</a>, <a href="/ja/">Japanese</a>, <a href="/ko/">Korean</a>, <a href="/pl/">Polish</a>, <a href="/es/">Spanish</a>, <a href="/pt/">Portuguese</a>, <a href="/zh_CN/">Simplified Chinese</a>, <a href="/zh_TW/">Traditional Chinese</a>, <a href="/id/">Bahasa Indonesia</a>, <a href="/de/">German</a> and <a href="/it/">Italian</a>.</p>
|
224
|
+
<p>This website is made with Ruby and powered by <a href="http://radiantcms.org">Radiant CMS</a>.
|
225
|
+
It is proudly maintained by <a href="http://rubyidentity.org">members of the Ruby community</a>. Please contact
|
226
|
+
our <a href="mailto:webmaster@ruby-lang.org">webmaster</a> for questions or comments
|
227
|
+
concerning this website.</p>
|
228
|
+
</div>
|
229
|
+
</div>
|
230
|
+
</div>
|
231
|
+
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
232
|
+
</script>
|
233
|
+
<script type="text/javascript">
|
234
|
+
_uacct = "UA-620926-1";
|
235
|
+
urchinTracker();
|
236
|
+
</script>
|
237
|
+
</body>
|
238
|
+
</html>
|
data/test/tc_html_parser.rb
CHANGED
@@ -15,7 +15,7 @@ class HtmlParserTest < Test::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def html_file
|
18
|
-
File.expand_path(File.join(File.dirname(__FILE__), 'model/
|
18
|
+
File.expand_path(File.join(File.dirname(__FILE__), 'model/ruby-lang.html'))
|
19
19
|
end
|
20
20
|
|
21
21
|
# ----- Sources ------
|
@@ -37,7 +37,6 @@ class HtmlParserTest < Test::Unit::TestCase
|
|
37
37
|
|
38
38
|
doc = xp.parse
|
39
39
|
assert_instance_of(XML::Document, doc)
|
40
|
-
assert_instance_of(XML::Parser::Context, xp.context)
|
41
40
|
end
|
42
41
|
|
43
42
|
def test_io
|
@@ -49,7 +48,6 @@ class HtmlParserTest < Test::Unit::TestCase
|
|
49
48
|
|
50
49
|
doc = xp.parse
|
51
50
|
assert_instance_of(XML::Document, doc)
|
52
|
-
assert_instance_of(XML::Parser::Context, xp.context)
|
53
51
|
end
|
54
52
|
end
|
55
53
|
|
@@ -63,7 +61,6 @@ class HtmlParserTest < Test::Unit::TestCase
|
|
63
61
|
|
64
62
|
doc = xp.parse
|
65
63
|
assert_instance_of(XML::Document, doc)
|
66
|
-
assert_instance_of(XML::Parser::Context, xp.context)
|
67
64
|
end
|
68
65
|
|
69
66
|
def test_libxml_html_parser_parse
|
@@ -105,11 +102,4 @@ class HtmlParserTest < Test::Unit::TestCase
|
|
105
102
|
assert_instance_of XML::Node, world
|
106
103
|
assert_equal 'World', world.content
|
107
104
|
end
|
108
|
-
|
109
|
-
def test_libxml_html_parser_context
|
110
|
-
doc = @xp.parse
|
111
|
-
assert_instance_of(XML::Document, doc)
|
112
|
-
assert_instance_of(XML::Parser::Context, @xp.context)
|
113
|
-
assert @xp.context.html?
|
114
|
-
end
|
115
|
-
end
|
105
|
+
end
|
data/test/tc_reader.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'xml'
|
2
2
|
require 'test/unit'
|
3
3
|
|
4
|
-
class
|
4
|
+
class TestReader < Test::Unit::TestCase
|
5
5
|
|
6
6
|
SIMPLE_XML = File.join(File.dirname(__FILE__), 'model/simple.xml')
|
7
7
|
|
@@ -34,75 +34,75 @@ class TextReader < Test::Unit::TestCase
|
|
34
34
|
XML::Reader::TYPE_END_ELEMENT])
|
35
35
|
end
|
36
36
|
|
37
|
-
def test_file
|
38
|
-
reader = XML::Reader.file(SIMPLE_XML)
|
39
|
-
verify_simple(reader)
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_invalid_file
|
43
|
-
assert_raises(RuntimeError) do
|
44
|
-
XML::Reader.file('/does/not/exist')
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_string
|
49
|
-
reader = XML::Reader.string(File.read(SIMPLE_XML))
|
50
|
-
verify_simple(reader)
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_io
|
54
|
-
File.open(SIMPLE_XML, 'rb') do |io|
|
55
|
-
reader = XML::Reader.io(io)
|
56
|
-
verify_simple(reader)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_string_io
|
61
|
-
data = File.read(SIMPLE_XML)
|
62
|
-
string_io = StringIO.new(data)
|
63
|
-
reader = XML::Reader.io(string_io)
|
64
|
-
verify_simple(reader)
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_new_walker
|
68
|
-
reader = XML::Reader.walker(XML::Document.file(SIMPLE_XML))
|
69
|
-
verify_simple(reader)
|
70
|
-
end
|
71
|
-
|
72
|
-
def test_deprecated_error_handler
|
73
|
-
called = false
|
74
|
-
reader = XML::Reader.new('<foo blah')
|
75
|
-
reader.set_error_handler do |error|
|
76
|
-
called = true
|
77
|
-
end
|
78
|
-
|
79
|
-
reader.read
|
80
|
-
assert(called)
|
81
|
-
end
|
82
|
-
|
83
|
-
def test_deprecated_reset_error_handler
|
84
|
-
called = false
|
85
|
-
reader = XML::Reader.new('<foo blah')
|
86
|
-
reader.set_error_handler do |error|
|
87
|
-
called = true
|
88
|
-
end
|
89
|
-
reader.reset_error_handler
|
90
|
-
|
91
|
-
reader.read
|
92
|
-
assert(!called)
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_attr
|
96
|
-
parser = XML::Reader.new("<foo x='1' y='2'/>")
|
97
|
-
assert_equal(1, parser.read)
|
98
|
-
assert_equal('foo', parser.name)
|
99
|
-
assert_equal('1', parser['x'])
|
100
|
-
assert_equal('1', parser[0])
|
101
|
-
assert_equal('2', parser['y'])
|
102
|
-
assert_equal('2', parser[1])
|
103
|
-
assert_equal(nil, parser['z'])
|
104
|
-
assert_equal(nil, parser[2])
|
105
|
-
end
|
37
|
+
# def test_file
|
38
|
+
# reader = XML::Reader.file(SIMPLE_XML)
|
39
|
+
# verify_simple(reader)
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# def test_invalid_file
|
43
|
+
# assert_raises(RuntimeError) do
|
44
|
+
# XML::Reader.file('/does/not/exist')
|
45
|
+
# end
|
46
|
+
# end
|
47
|
+
#
|
48
|
+
# def test_string
|
49
|
+
# reader = XML::Reader.string(File.read(SIMPLE_XML))
|
50
|
+
# verify_simple(reader)
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# def test_io
|
54
|
+
# File.open(SIMPLE_XML, 'rb') do |io|
|
55
|
+
# reader = XML::Reader.io(io)
|
56
|
+
# verify_simple(reader)
|
57
|
+
# end
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# def test_string_io
|
61
|
+
# data = File.read(SIMPLE_XML)
|
62
|
+
# string_io = StringIO.new(data)
|
63
|
+
# reader = XML::Reader.io(string_io)
|
64
|
+
# verify_simple(reader)
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
# def test_new_walker
|
68
|
+
# reader = XML::Reader.walker(XML::Document.file(SIMPLE_XML))
|
69
|
+
# verify_simple(reader)
|
70
|
+
# end
|
71
|
+
#
|
72
|
+
# def test_deprecated_error_handler
|
73
|
+
# called = false
|
74
|
+
# reader = XML::Reader.new('<foo blah')
|
75
|
+
# reader.set_error_handler do |error|
|
76
|
+
# called = true
|
77
|
+
# end
|
78
|
+
#
|
79
|
+
# reader.read
|
80
|
+
# assert(called)
|
81
|
+
# end
|
82
|
+
#
|
83
|
+
# def test_deprecated_reset_error_handler
|
84
|
+
# called = false
|
85
|
+
# reader = XML::Reader.new('<foo blah')
|
86
|
+
# reader.set_error_handler do |error|
|
87
|
+
# called = true
|
88
|
+
# end
|
89
|
+
# reader.reset_error_handler
|
90
|
+
#
|
91
|
+
# reader.read
|
92
|
+
# assert(!called)
|
93
|
+
# end
|
94
|
+
#
|
95
|
+
# def test_attr
|
96
|
+
# parser = XML::Reader.new("<foo x='1' y='2'/>")
|
97
|
+
# assert_equal(1, parser.read)
|
98
|
+
# assert_equal('foo', parser.name)
|
99
|
+
# assert_equal('1', parser['x'])
|
100
|
+
# assert_equal('1', parser[0])
|
101
|
+
# assert_equal('2', parser['y'])
|
102
|
+
# assert_equal('2', parser[1])
|
103
|
+
# assert_equal(nil, parser['z'])
|
104
|
+
# assert_equal(nil, parser[2])
|
105
|
+
# end
|
106
106
|
|
107
107
|
def test_value
|
108
108
|
parser = XML::Reader.new("<foo><bar>1</bar><bar>2</bar><bar>3</bar></foo>")
|
@@ -121,21 +121,21 @@ class TextReader < Test::Unit::TestCase
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
def test_expand
|
125
|
-
reader = XML::Reader.file(SIMPLE_XML)
|
126
|
-
reader.read
|
127
|
-
node = reader.expand
|
128
|
-
doc = node.doc
|
129
|
-
reader.close
|
130
|
-
GC.start
|
131
|
-
|
132
|
-
doc.standalone?
|
133
|
-
end
|
134
|
-
|
135
|
-
def test_mode
|
136
|
-
reader = XML::Reader.string('<xml/>')
|
137
|
-
assert_equal(XML::Reader::MODE_INITIAL, reader.read_state)
|
138
|
-
reader.read
|
139
|
-
assert_equal(XML::Reader::MODE_EOF, reader.read_state)
|
140
|
-
end
|
124
|
+
# def test_expand
|
125
|
+
# reader = XML::Reader.file(SIMPLE_XML)
|
126
|
+
# reader.read
|
127
|
+
# node = reader.expand
|
128
|
+
# doc = node.doc
|
129
|
+
# reader.close
|
130
|
+
# GC.start
|
131
|
+
#
|
132
|
+
# doc.standalone?
|
133
|
+
# end
|
134
|
+
#
|
135
|
+
# def test_mode
|
136
|
+
# reader = XML::Reader.string('<xml/>')
|
137
|
+
# assert_equal(XML::Reader::MODE_INITIAL, reader.read_state)
|
138
|
+
# reader.read
|
139
|
+
# assert_equal(XML::Reader::MODE_EOF, reader.read_state)
|
140
|
+
# end
|
141
141
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libxml-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: x86-mswin32-60
|
6
6
|
authors:
|
7
7
|
- Charlie Savage
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-11-
|
12
|
+
date: 2008-11-24 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -27,6 +27,20 @@ files:
|
|
27
27
|
- LICENSE
|
28
28
|
- CHANGES
|
29
29
|
- setup.rb
|
30
|
+
- doc/css
|
31
|
+
- doc/css/normal.css
|
32
|
+
- doc/img
|
33
|
+
- doc/img/raze-tiny.png
|
34
|
+
- doc/img/red-cube.jpg
|
35
|
+
- doc/img/xml-ruby.png
|
36
|
+
- doc/index.xml
|
37
|
+
- doc/install.xml
|
38
|
+
- doc/layout.rhtml
|
39
|
+
- doc/layout.xsl
|
40
|
+
- doc/license.xml
|
41
|
+
- doc/log
|
42
|
+
- doc/log/changelog.xml
|
43
|
+
- doc/log/changelog.xsl
|
30
44
|
- ext/libxml/cbg.c
|
31
45
|
- ext/libxml/extconf.rb
|
32
46
|
- ext/libxml/libxml.c
|
@@ -119,6 +133,7 @@ files:
|
|
119
133
|
- test/model/books.xml
|
120
134
|
- test/model/default_validation_bug.rb
|
121
135
|
- test/model/merge_bug_data.xml
|
136
|
+
- test/model/ruby-lang.html
|
122
137
|
- test/model/rubynet.xml
|
123
138
|
- test/model/rubynet_project
|
124
139
|
- test/model/saxtest.xml
|
@@ -161,7 +176,6 @@ files:
|
|
161
176
|
- test/tc_xpath_context.rb
|
162
177
|
- test/tc_xpath_expression.rb
|
163
178
|
- test/tc_xpointer.rb
|
164
|
-
- test/test.rb
|
165
179
|
- test/test_suite.rb
|
166
180
|
- ext/mingw/libxml_ruby.so
|
167
181
|
- ext/mingw/libiconv-2.dll
|
data/test/test.rb
DELETED