libxml-ruby 5.0.0-x64-mingw-ucrt → 5.0.1-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2597b3a2369dd697ecf208bc7453e470fca96255761ed6909d089576a54dc480
4
- data.tar.gz: 0ad2245319036e3037f95c988005db027e522166536dbff0be77142104b031b9
3
+ metadata.gz: b7d18cd1b2da9ad060e5f82304c15c84d693234be8d51027e7070e8462687c60
4
+ data.tar.gz: c7a0f7748c84bccdb11601fbd26934c1c26d5bdedfaa983908b9c796d559f472
5
5
  SHA512:
6
- metadata.gz: 0f0da0d7e285691f132c4da7d8e732c8f826819427eb2a17476d1c191486e7217749e7835a5cfe929aad3e5418652dce93d25d609013b4721edb89ad571d6ee6
7
- data.tar.gz: c567ce32a8ef312fd866189c93b6cfd1cc9391c740117496b0d2bf639578916a86758f3a896e08040891a1e67224fe83d88a529e9f92ebf532a334883ac6c93a
6
+ metadata.gz: 71b4750282d6ae545c0f72a478cc0c9ad9d29e00934934aa1693b8e6890610ef48ce50e644f0dc2a9ff56dddee99ce991cb58e582bdca70e8cb613f28c629747
7
+ data.tar.gz: 3e967314278f64210a29f45cefae3ba7b2c139e3121b803cdbc6b1abd8d8831f7e65db184cd25708b6bf0e70d242e2a0dbe1dab6ac603ff5cfa5eaac1ed3f24f
data/HISTORY CHANGED
@@ -1,5 +1,9 @@
1
1
  = Release History
2
2
 
3
+ == 5.0.1 / 2024-01-08
4
+
5
+ * Fix broken Document#io method that was broken by switching Parsers to use keyword arguments
6
+
3
7
  == 5.0.0 / 2024-01-07
4
8
 
5
9
  * This release is major version bump because it removes access to global parser options
@@ -8,9 +12,8 @@
8
12
  Specifically, instead of setting global parser options, pass them directly to either Parsers
9
13
  or ParserContexts when creating them. Options are defined as constants in
10
14
  LibXML::XML::Parser::Options and LibXML::HTML::Parser::Options
11
- * Update Parser initialize methods to take named parameters instead of a hash table (you should *not*
12
- have to update your code due to this change)
13
- * Fix broken compiliation with libxml2 version 2.12.0 (due to libxml2 header changes)
15
+ * Update Parser initialize methods to take keyword parameters instead of a hash table (you may have to update your code due to this change)
16
+ * Fix broken compilation with libxml2 version 2.12.0 (due to libxml2 header changes)
14
17
  * Add support for Ruby 3.3.*
15
18
  * Remove support for Ruby 2.7.* (gem should still work but is no longer tested)
16
19
 
data/README.rdoc CHANGED
@@ -11,7 +11,7 @@ We think libxml-ruby is the best XML library for Ruby because:
11
11
  * Conformance - It passes all 1800+ tests from the OASIS XML Tests Suite
12
12
 
13
13
  == Requirements
14
- libxml-ruby requires Ruby 1.8.7 or higher. It depends on libxml2 to
14
+ libxml-ruby requires Ruby 3.0.0 or higher. It depends on libxml2 to
15
15
  function properly. libxml2, in turn, depends on:
16
16
 
17
17
  * libm (math routines: very standard)
@@ -20,9 +20,9 @@ function properly. libxml2, in turn, depends on:
20
20
 
21
21
  If you are running Linux or Unix you'll need a C compiler so the
22
22
  extension can be compiled when it is installed. If you are running
23
- Windows, then install the x64-mingw32 gem or build it yourself using
24
- Devkit[http://rubyinstaller.org/add-ons/devkit/] or
25
- msys2[https://msys2.github.io/].
23
+ Windows, then install the x64-mingw-ucr gem or build it yourself using (Ruby
24
+ for Windows)[https://rubyinstaller.org/] or directly with msys2[https://msys2.github.io/]
25
+ and ucrt64.
26
26
 
27
27
  == Installation
28
28
  The easiest way to install libxml-ruby is via RubyGems. To install:
@@ -46,13 +46,9 @@ Or bundler:
46
46
  <tt>bundle install libxml-ruby</tt>
47
47
 
48
48
  If you are running Windows, then install the libxml-ruby-x64-mingw32 gem.
49
- The gem includes prebuilt extensions for Ruby 2.3. These
50
- extensions are built using MinGW64 and libxml2 version 2.9.3,
51
- iconv version 1.14 and zlib version 1.2.8. Note these binaries
52
- are available in the <tt>lib\\libs</tt> directory. To use them, put them
53
- on your <tt>PATH</tt>.
49
+ The gem includes prebuilt extensions for Ruby 3.2 and 3.3.
54
50
 
55
- The gem also includes a Microsoft VC++ 2012 solution and XCode 5 project - these
51
+ The gem also includes a Microsoft VC++ solution and XCode project - these
56
52
  are very useful for debugging.
57
53
 
58
54
  libxml-ruby's source codes lives on GitHub[https://github.com/xml4r/libxml-ruby].
@@ -128,11 +124,6 @@ For example:
128
124
 
129
125
  For simplicity's sake, the documentation uses the xml module in its examples.
130
126
 
131
- == Threading
132
- libxml-ruby fully supports native, background Ruby threads. This of course
133
- only applies to Ruby 1.9.x and higher since earlier versions of Ruby do not
134
- support native threads.
135
-
136
127
  == Tests
137
128
 
138
129
  To run tests you first need to build the shared libary:
@@ -143,7 +134,7 @@ Once you have build the shared libary, you can then run tests using rake:
143
134
 
144
135
  rake test
145
136
 
146
- +Travis build status: {<img src="https://travis-ci.org/xml4r/libxml-ruby.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/xml4r/libxml-ruby]
137
+ +Build status: {rdoc-image:https://github.com/xml4r/libxml-ruby/actions/workflows/mri.yml/badge.svg}[https://github.com/xml4r/libxml-ruby/actions/workflows/mri.yml]
147
138
 
148
139
  == Performance
149
140
 
@@ -124,112 +124,118 @@ static VALUE rxml_dtd_type(VALUE self)
124
124
 
125
125
  /*
126
126
  * call-seq:
127
- * XML::Dtd.new("DTD string") -> dtd
128
- * XML::Dtd.new("public", "system") -> dtd
129
- * XML::Dtd.new("name", "public", "system", document) -> external subset dtd
130
- * XML::Dtd.new("name", "public", "system", document, false) -> internal subset dtd
131
- * XML::Dtd.new("name", "public", "system", document, true) -> internal subset dtd
127
+ * XML::Dtd.new(dtd_string) -> dtd
128
+ * XML::Dtd.new(external_id, system_id) -> dtd
129
+ * XML::Dtd.new(external_id, system_id, name, document, internal) -> dtd
132
130
  *
133
- * Create a new Dtd from the specified public and system
134
- * identifiers.
131
+ * Create a new Dtd from the specified public and system identifiers:
132
+ *
133
+ * * The first usage creates a DTD from a string and requires 1 parameter.
134
+ * * The second usage loads and parses an external DTD and requires 2 parameters.
135
+ * * The third usage creates a new internal or external DTD and requires 3 parameters and 2 optional parameters.
136
+ * It then attaches the DTD to the specified document if it is not nil
137
+ *
138
+ * Parameters:
139
+ *
140
+ * dtd_string - A string that contains a complete DTD
141
+ * external_id - A string that specifies the DTD's external name. For example, "-//W3C//DTD XHTML 1.0 Transitional//EN"
142
+ * system_id - A string that specififies the DTD's system name. For example, "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
143
+ * name - A string that specifies the DTD's name. For example "xhtml1".
144
+ * document - A xml document.
145
+ * internal - Boolean value indicating whether this is an internal or external DTD. Optional. If not specified
146
+ * then external is assumed.
135
147
  */
136
148
  static VALUE rxml_dtd_initialize(int argc, VALUE *argv, VALUE self)
137
149
  {
138
- VALUE external, system, dtd_string;
139
- xmlParserInputBufferPtr buffer;
140
- xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
141
- xmlChar *new_string;
142
150
  xmlDtdPtr xdtd;
151
+ VALUE external, system;
143
152
 
144
- // 1 argument -- string --> parsujeme jako dtd
145
- // 2 arguments -- public, system --> bude se hledat
146
- // 3 arguments -- public, system, name --> creates an external subset (any parameter may be nil)
147
- // 4 arguments -- public, system, name, doc --> creates an external subset (any parameter may be nil)
148
- // 5 arguments -- public, system, name, doc, true --> creates an internal subset (all but last parameter may be nil)
149
153
  switch (argc)
150
154
  {
151
- case 3:
152
- case 4:
153
- case 5: {
154
- VALUE name, doc, internal;
155
- const xmlChar *xname = NULL, *xpublic = NULL, *xsystem = NULL;
156
- xmlDocPtr xdoc = NULL;
155
+ case 3:
156
+ case 4:
157
+ case 5:
158
+ {
159
+ const xmlChar *xname = NULL, *xpublic = NULL, *xsystem = NULL;
160
+ xmlDocPtr xdoc = NULL;
157
161
 
158
- rb_scan_args(argc, argv, "32", &external, &system, &name, &doc, &internal);
162
+ VALUE name, doc, internal;
163
+ rb_scan_args(argc, argv, "32", &external, &system, &name, &doc, &internal);
159
164
 
160
- if (external != Qnil) {
161
- Check_Type(external, T_STRING);
162
- xpublic = (const xmlChar*) StringValuePtr(external);
163
- }
164
- if (system != Qnil) {
165
- Check_Type(system, T_STRING);
166
- xsystem = (const xmlChar*) StringValuePtr(system);
167
- }
168
- if (name != Qnil) {
169
- Check_Type(name, T_STRING);
170
- xname = (const xmlChar*) StringValuePtr(name);
171
- }
172
- if (doc != Qnil) {
173
- if (rb_obj_is_kind_of(doc, cXMLDocument) == Qfalse)
174
- rb_raise(rb_eTypeError, "Must pass an LibXML::XML::Document object");
175
- Data_Get_Struct(doc, xmlDoc, xdoc);
176
- }
165
+ Check_Type(external, T_STRING);
166
+ xpublic = (const xmlChar*) StringValuePtr(external);
177
167
 
178
- if (internal == Qnil || internal == Qfalse)
179
- xdtd = xmlNewDtd(xdoc, xname, xpublic, xsystem);
180
- else
181
- xdtd = xmlCreateIntSubset(xdoc, xname, xpublic, xsystem);
168
+ Check_Type(system, T_STRING);
169
+ xsystem = (const xmlChar*) StringValuePtr(system);
182
170
 
183
- if (xdtd == NULL)
184
- rxml_raise(xmlGetLastError());
171
+ Check_Type(name, T_STRING);
172
+ xname = (const xmlChar*) StringValuePtr(name);
185
173
 
186
- /* Document will free this dtd now. */
187
- RDATA(self)->dfree = NULL;
188
- DATA_PTR(self) = xdtd;
174
+ if (doc != Qnil)
175
+ {
176
+ if (rb_obj_is_kind_of(doc, cXMLDocument) == Qfalse)
177
+ rb_raise(rb_eTypeError, "Must pass an LibXML::XML::Document object");
178
+ Data_Get_Struct(doc, xmlDoc, xdoc);
179
+ }
189
180
 
190
- xmlSetTreeDoc((xmlNodePtr) xdtd, xdoc);
191
- }
192
- break;
181
+ if (internal == Qnil || internal == Qfalse)
182
+ xdtd = xmlNewDtd(xdoc, xname, xpublic, xsystem);
183
+ else
184
+ xdtd = xmlCreateIntSubset(xdoc, xname, xpublic, xsystem);
193
185
 
194
- case 2:
195
- rb_scan_args(argc, argv, "20", &external, &system);
186
+ if (xdtd == NULL)
187
+ rxml_raise(xmlGetLastError());
196
188
 
197
- Check_Type(external, T_STRING);
198
- Check_Type(system, T_STRING);
189
+ /* The document will free the dtd so Ruby should not */
190
+ RDATA(self)->dfree = NULL;
191
+ DATA_PTR(self) = xdtd;
199
192
 
200
- xdtd = xmlParseDTD((xmlChar*) StringValuePtr(external),
201
- (xmlChar*) StringValuePtr(system));
193
+ xmlSetTreeDoc((xmlNodePtr) xdtd, xdoc);
194
+ }
195
+ break;
202
196
 
203
- if (xdtd == NULL)
204
- rxml_raise(xmlGetLastError());
197
+ case 2:
198
+ {
199
+ rb_scan_args(argc, argv, "20", &external, &system);
205
200
 
206
- DATA_PTR(self) = xdtd;
201
+ Check_Type(external, T_STRING);
202
+ Check_Type(system, T_STRING);
207
203
 
208
- xmlSetTreeDoc((xmlNodePtr) xdtd, NULL);
209
- break;
204
+ xdtd = xmlParseDTD((xmlChar*) StringValuePtr(external), (xmlChar*) StringValuePtr(system));
210
205
 
211
- case 1:
212
- rb_scan_args(argc, argv, "10", &dtd_string);
213
- Check_Type(dtd_string, T_STRING);
206
+ if (xdtd == NULL)
207
+ rxml_raise(xmlGetLastError());
214
208
 
215
- /* Note that buffer is freed by xmlParserInputBufferPush*/
216
- buffer = xmlAllocParserInputBuffer(enc);
217
- new_string = xmlStrdup((xmlChar*) StringValuePtr(dtd_string));
218
- xmlParserInputBufferPush(buffer, xmlStrlen(new_string),
219
- (const char*) new_string);
209
+ DATA_PTR(self) = xdtd;
220
210
 
221
- xdtd = xmlIOParseDTD(NULL, buffer, enc);
211
+ xmlSetTreeDoc((xmlNodePtr) xdtd, NULL);
212
+ break;
213
+ }
214
+ case 1:
215
+ {
216
+ VALUE dtd_string;
217
+ rb_scan_args(argc, argv, "10", &dtd_string);
218
+ Check_Type(dtd_string, T_STRING);
222
219
 
223
- if (xdtd == NULL)
224
- rxml_raise(xmlGetLastError());
220
+ /* Note that buffer is freed by xmlParserInputBufferPush*/
221
+ xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
222
+ xmlParserInputBufferPtr buffer = xmlAllocParserInputBuffer(enc);
223
+ xmlChar *new_string = xmlStrdup((xmlChar*) StringValuePtr(dtd_string));
224
+ xmlParserInputBufferPush(buffer, xmlStrlen(new_string),
225
+ (const char*) new_string);
225
226
 
226
- xmlFree(new_string);
227
+ xdtd = xmlIOParseDTD(NULL, buffer, enc);
227
228
 
228
- DATA_PTR(self) = xdtd;
229
- break;
229
+ if (xdtd == NULL)
230
+ rxml_raise(xmlGetLastError());
230
231
 
231
- default:
232
- rb_raise(rb_eArgError, "wrong number of arguments");
232
+ xmlFree(new_string);
233
+
234
+ DATA_PTR(self) = xdtd;
235
+ break;
236
+ }
237
+ default:
238
+ rb_raise(rb_eArgError, "wrong number of arguments");
233
239
  }
234
240
 
235
241
  return self;
@@ -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 "5.0.0"
5
- #define RUBY_LIBXML_VERNUM 500
4
+ #define RUBY_LIBXML_VERSION "5.0.1"
5
+ #define RUBY_LIBXML_VERNUM 501
6
6
  #define RUBY_LIBXML_VER_MAJ 5
7
7
  #define RUBY_LIBXML_VER_MIN 0
8
- #define RUBY_LIBXML_VER_MIC 0
8
+ #define RUBY_LIBXML_VER_MIC 1
9
9
  #define RUBY_LIBXML_VER_PATCH 0
Binary file
Binary file
@@ -51,8 +51,8 @@ module LibXML
51
51
  # options - Parser options. Valid values are the constants defined on
52
52
  # XML::Parser::Options. Mutliple options can be combined
53
53
  # by using Bitwise OR (|).
54
- def self.io(value, options = {})
55
- Parser.io(value, options).parse
54
+ def self.io(io, base_uri: nil, encoding: nil, options: nil)
55
+ Parser.io(io, base_uri: base_uri, encoding: encoding, options: options).parse
56
56
  end
57
57
 
58
58
  # call-seq:
@@ -129,4 +129,12 @@ class TestDocument < Minitest::Test
129
129
  file = File.join(File.dirname(__FILE__), 'model/atom.xml')
130
130
  schema_document = LibXML::XML::Document.file(file, options: LibXML::XML::Parser::Options::NONET)
131
131
  end
132
+
133
+ def test_io
134
+ File.open(File.join(File.dirname(__FILE__), 'model/rubynet.xml')) do |io|
135
+ doc = LibXML::XML::Document.io(io)
136
+ assert_instance_of(LibXML::XML::Document, doc)
137
+ end
138
+ end
139
+
132
140
  end
data/test/test_dtd.rb CHANGED
@@ -31,13 +31,13 @@ class TestDtd < Minitest::Test
31
31
  end
32
32
 
33
33
  def test_internal_subset
34
- xhtml_dtd = LibXML::XML::Dtd.new "-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", nil, nil, true
34
+ xhtml_dtd = LibXML::XML::Dtd.new("-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", nil, nil, true)
35
35
  assert xhtml_dtd.name.nil?
36
36
  assert_equal "-//W3C//DTD XHTML 1.0 Transitional//EN", xhtml_dtd.external_id
37
37
  assert_equal "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", xhtml_dtd.uri
38
38
  assert_equal "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", xhtml_dtd.system_id
39
39
 
40
- xhtml_dtd = LibXML::XML::Dtd.new "-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", "xhtml1", nil, true
40
+ xhtml_dtd = LibXML::XML::Dtd.new("-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", "xhtml1", nil, true)
41
41
  assert_equal "xhtml1", xhtml_dtd.name
42
42
  assert_equal "-//W3C//DTD XHTML 1.0 Transitional//EN", xhtml_dtd.external_id
43
43
  assert_equal "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", xhtml_dtd.uri
@@ -45,13 +45,13 @@ class TestDtd < Minitest::Test
45
45
  end
46
46
 
47
47
  def test_external_subset
48
- xhtml_dtd = LibXML::XML::Dtd.new "-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", nil
48
+ xhtml_dtd = LibXML::XML::Dtd.new("-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", nil)
49
49
  assert xhtml_dtd.name.nil?
50
50
  assert_equal "-//W3C//DTD XHTML 1.0 Transitional//EN", xhtml_dtd.external_id
51
51
  assert_equal "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", xhtml_dtd.uri
52
52
  assert_equal "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", xhtml_dtd.system_id
53
53
 
54
- xhtml_dtd = LibXML::XML::Dtd.new "-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", "xhtml1"
54
+ xhtml_dtd = LibXML::XML::Dtd.new("-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", "xhtml1")
55
55
  assert_equal "xhtml1", xhtml_dtd.name
56
56
  assert_equal "-//W3C//DTD XHTML 1.0 Transitional//EN", xhtml_dtd.external_id
57
57
  assert_equal "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", xhtml_dtd.uri
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: 5.0.0
4
+ version: 5.0.1
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Ross Bamform
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2024-01-07 00:00:00.000000000 Z
17
+ date: 2024-01-08 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rake-compiler
@@ -276,7 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  - !ruby/object:Gem::Version
277
277
  version: '0'
278
278
  requirements: []
279
- rubygems_version: 3.5.3
279
+ rubygems_version: 3.4.21
280
280
  signing_key:
281
281
  specification_version: 4
282
282
  summary: Ruby Bindings for LibXML2