libxml-ruby 2.3.0-x86-mingw32 → 2.3.3-x86-mingw32
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.
- data/HISTORY +15 -1
- data/ext/libxml/ruby_xml_document.c +10 -4
- data/ext/libxml/ruby_xml_error.c +19 -1
- data/ext/libxml/ruby_xml_reader.c +1 -1
- data/ext/libxml/ruby_xml_version.h +3 -3
- data/lib/1.8/libxml_ruby.so +0 -0
- data/lib/1.9/libxml_ruby.so +0 -0
- data/test/tc_error.rb +13 -1
- metadata +23 -40
data/HISTORY
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
= Release History
|
2
2
|
|
3
|
-
== 2.3.
|
3
|
+
== 2.3.3 / 2012-07-01 Charlie Savage
|
4
|
+
|
5
|
+
* Add LibXML::XML::Error.get_handler (Carsten Zimmermann)
|
6
|
+
* Fix variable name in example (Marcus)
|
7
|
+
|
8
|
+
== 2.3.2 / 2012-03-20 Charlie Savage
|
9
|
+
|
10
|
+
* Define various canonicalize constants to support libxml2 versions
|
11
|
+
older than 1.1.25 (thanks Apple!)
|
12
|
+
|
13
|
+
== 2.3.1 / 2012-03-20 Charlie Savage
|
14
|
+
|
15
|
+
* Yanked - didn't fix the OSX canonicalize issue
|
16
|
+
|
17
|
+
== 2.3.0 / 2012-03-18 Charlie Savage
|
4
18
|
|
5
19
|
* Add ability to insert new PI-nodes into the xmltree (Axel Struebing).
|
6
20
|
|
@@ -142,10 +142,16 @@ static VALUE rxml_document_initialize(int argc, VALUE *argv, VALUE self)
|
|
142
142
|
return self;
|
143
143
|
}
|
144
144
|
|
145
|
-
/*
|
146
|
-
|
147
|
-
|
148
|
-
|
145
|
+
/* XML_C14N_1* constants are not defined until libxml 1.1.25, so if they
|
146
|
+
are not defined then define these constants to map to zero,
|
147
|
+
the same value as XML_C14N_1_0. */
|
148
|
+
|
149
|
+
/* XML_C14N* constants are not defined until libxml 1.1.25, so define them
|
150
|
+
if needed so things compile. */
|
151
|
+
#ifndef XML_C14N_1_0
|
152
|
+
#define XML_C14N_1_0 0
|
153
|
+
#define XML_C14N_EXCLUSIVE_1_0 XML_C14N_1_0
|
154
|
+
#define XML_C14N_1_1 XML_C14N_1_0
|
149
155
|
#endif
|
150
156
|
|
151
157
|
/*
|
data/ext/libxml/ruby_xml_error.c
CHANGED
@@ -22,6 +22,10 @@ static ID ERROR_HANDLER_ID;
|
|
22
22
|
*
|
23
23
|
* XML::Error.set_handler(&XML::Error::QUIET_HANDLER)
|
24
24
|
*
|
25
|
+
* Get the current handler:
|
26
|
+
*
|
27
|
+
* proc = XML::Error.get_handler
|
28
|
+
*
|
25
29
|
* Install your own handler:
|
26
30
|
*
|
27
31
|
* XML::Error.set_handler do |error|
|
@@ -42,6 +46,19 @@ static void rxml_set_handler(VALUE self, VALUE block)
|
|
42
46
|
#endif
|
43
47
|
}
|
44
48
|
|
49
|
+
/*
|
50
|
+
* call-seq:
|
51
|
+
* Error.get_error_handler
|
52
|
+
*
|
53
|
+
* Returns the proc that will be called when libxml generates
|
54
|
+
* warning, error or fatal error messages.
|
55
|
+
*/
|
56
|
+
static VALUE rxml_error_get_handler()
|
57
|
+
{
|
58
|
+
VALUE block = rb_cvar_get(eXMLError, ERROR_HANDLER_ID);
|
59
|
+
return block;
|
60
|
+
}
|
61
|
+
|
45
62
|
/*
|
46
63
|
* call-seq:
|
47
64
|
* Error.set_error_handler {|error| ... }
|
@@ -129,7 +146,7 @@ static void structuredErrorFunc(void *userData, xmlErrorPtr xerror)
|
|
129
146
|
VALUE error = rxml_error_wrap(xerror);
|
130
147
|
|
131
148
|
/* Wrap error up as Ruby object and send it off to ruby */
|
132
|
-
VALUE block =
|
149
|
+
VALUE block = rxml_error_get_handler();
|
133
150
|
|
134
151
|
/* Now call global handler */
|
135
152
|
if (block != Qnil)
|
@@ -155,6 +172,7 @@ void rxml_init_error()
|
|
155
172
|
|
156
173
|
/* Error class */
|
157
174
|
eXMLError = rb_define_class_under(mXML, "Error", rb_eStandardError);
|
175
|
+
rb_define_singleton_method(eXMLError, "get_handler", rxml_error_get_handler, 0);
|
158
176
|
rb_define_singleton_method(eXMLError, "set_handler", rxml_error_set_handler, 0);
|
159
177
|
rb_define_singleton_method(eXMLError, "reset_handler", rxml_error_reset_handler, 0);
|
160
178
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
*
|
21
21
|
* Example:
|
22
22
|
*
|
23
|
-
*
|
23
|
+
* reader = XML::Reader.string("<foo><bar>1</bar><bar>2</bar><bar>3</bar></foo>")
|
24
24
|
* reader.read
|
25
25
|
* assert_equal('foo', reader.name)
|
26
26
|
* assert_equal(nil, reader.value)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/* Don't nuke this block! It is used for automatically updating the
|
2
2
|
* versions below. VERSION = string formatting, VERNUM = numbered
|
3
3
|
* version for inline testing: increment both or none at all.*/
|
4
|
-
#define RUBY_LIBXML_VERSION "2.3.
|
5
|
-
#define RUBY_LIBXML_VERNUM
|
4
|
+
#define RUBY_LIBXML_VERSION "2.3.3"
|
5
|
+
#define RUBY_LIBXML_VERNUM 233
|
6
6
|
#define RUBY_LIBXML_VER_MAJ 2
|
7
7
|
#define RUBY_LIBXML_VER_MIN 3
|
8
|
-
#define RUBY_LIBXML_VER_MIC
|
8
|
+
#define RUBY_LIBXML_VER_MIC 3
|
9
9
|
#define RUBY_LIBXML_VER_PATCH 0
|
data/lib/1.8/libxml_ruby.so
CHANGED
Binary file
|
data/lib/1.9/libxml_ruby.so
CHANGED
Binary file
|
data/test/tc_error.rb
CHANGED
@@ -59,6 +59,18 @@ class TestError < Test::Unit::TestCase
|
|
59
59
|
assert_nil(exception)
|
60
60
|
end
|
61
61
|
|
62
|
+
def test_get_handler
|
63
|
+
assert_respond_to(XML::Error, :get_handler)
|
64
|
+
assert_equal(0, XML::Error.method(:get_handler).arity)
|
65
|
+
|
66
|
+
saved_handler = XML::Error.get_handler
|
67
|
+
XML::Error.set_handler{ puts "New handler" }
|
68
|
+
assert_not_equal(XML::Error.get_handler, saved_handler)
|
69
|
+
|
70
|
+
XML::Error.set_handler(&saved_handler)
|
71
|
+
assert_equal(XML::Error.get_handler, saved_handler)
|
72
|
+
end
|
73
|
+
|
62
74
|
def test_verbose_handler
|
63
75
|
XML::Error.set_handler(&XML::Error::VERBOSE_HANDLER)
|
64
76
|
output = StringIO.new
|
@@ -147,4 +159,4 @@ class TestError < Test::Unit::TestCase
|
|
147
159
|
end
|
148
160
|
assert_equal('Must specify a string with one or more characters', error.to_s)
|
149
161
|
end
|
150
|
-
end
|
162
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: libxml-ruby
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.3.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 2
|
8
|
-
- 3
|
9
|
-
- 0
|
10
|
-
version: 2.3.0
|
11
6
|
platform: x86-mingw32
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Ross Bamform
|
14
9
|
- Wai-Sun Chia
|
15
10
|
- Sean Chittenden
|
@@ -20,19 +15,18 @@ authors:
|
|
20
15
|
autorequire:
|
21
16
|
bindir: bin
|
22
17
|
cert_chain: []
|
23
|
-
|
24
|
-
date: 2012-03-18 00:00:00 Z
|
18
|
+
date: 2012-07-01 00:00:00.000000000 Z
|
25
19
|
dependencies: []
|
26
|
-
|
27
|
-
|
20
|
+
description: ! " The Libxml-Ruby project provides Ruby language bindings for the
|
21
|
+
GNOME\n Libxml2 XML toolkit. It is free software, released under the MIT License.\n
|
22
|
+
\ Libxml-ruby's primary advantage over REXML is performance - if speed\n is
|
23
|
+
your need, these are good libraries to consider, as demonstrated\n by the informal
|
24
|
+
benchmark below.\n"
|
28
25
|
email:
|
29
26
|
executables: []
|
30
|
-
|
31
27
|
extensions: []
|
32
|
-
|
33
28
|
extra_rdoc_files: []
|
34
|
-
|
35
|
-
files:
|
29
|
+
files:
|
36
30
|
- HISTORY
|
37
31
|
- LICENSE
|
38
32
|
- libxml-ruby.gemspec
|
@@ -239,40 +233,29 @@ files:
|
|
239
233
|
- lib/libs/libz.dll
|
240
234
|
homepage: http://xml4r.github.com/libxml-ruby
|
241
235
|
licenses: []
|
242
|
-
|
243
236
|
post_install_message:
|
244
237
|
rdoc_options: []
|
245
|
-
|
246
|
-
require_paths:
|
238
|
+
require_paths:
|
247
239
|
- lib
|
248
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
240
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
249
241
|
none: false
|
250
|
-
requirements:
|
251
|
-
- -
|
252
|
-
- !ruby/object:Gem::Version
|
253
|
-
hash: 59
|
254
|
-
segments:
|
255
|
-
- 1
|
256
|
-
- 8
|
257
|
-
- 6
|
242
|
+
requirements:
|
243
|
+
- - ! '>='
|
244
|
+
- !ruby/object:Gem::Version
|
258
245
|
version: 1.8.6
|
259
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
246
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
247
|
none: false
|
261
|
-
requirements:
|
262
|
-
- -
|
263
|
-
- !ruby/object:Gem::Version
|
264
|
-
|
265
|
-
segments:
|
266
|
-
- 0
|
267
|
-
version: "0"
|
248
|
+
requirements:
|
249
|
+
- - ! '>='
|
250
|
+
- !ruby/object:Gem::Version
|
251
|
+
version: '0'
|
268
252
|
requirements: []
|
269
|
-
|
270
253
|
rubyforge_project:
|
271
|
-
rubygems_version: 1.8.
|
254
|
+
rubygems_version: 1.8.24
|
272
255
|
signing_key:
|
273
256
|
specification_version: 3
|
274
257
|
summary: Ruby Bindings for LibXML2
|
275
|
-
test_files:
|
258
|
+
test_files:
|
276
259
|
- test/tc_attr.rb
|
277
260
|
- test/tc_attributes.rb
|
278
261
|
- test/tc_attr_decl.rb
|