libxml-ruby 3.2.1 → 3.2.2

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: f8b07d4dd732e06fdc8d4ffefcc9f9ea4a2a70faf8504bfdc1ef064e466656f9
4
- data.tar.gz: 31fb804f2d87c2b3db049eb24eb2086bbaadc8a3850314060bc066fa87b078f9
3
+ metadata.gz: 40cfe66ffd84495bc2bd079978d06abd01be932513d0c04160453fe04c33db6c
4
+ data.tar.gz: 1c45a468970af35413989b9af9f516efb1fc7aae17b401fa83626a762141d04e
5
5
  SHA512:
6
- metadata.gz: 21126d00b18029300b5d49d32d4534071453d1dfb76e51fbc86d311e47779e606885fe792ca3bc58aab98bafe8dc3e4153cefce5f9bdb41db47755fba00ed44f
7
- data.tar.gz: f510878992373c898082dfd6291bf6fb4d1b8d096095d08ec2a2550ca99f3b0bcc22b53d230f314e05a3e3fed17e8caf3fea9cc49f5fa682b6c39d44ece876db
6
+ metadata.gz: 6352fc0f0414020fbd48118313e6557e18f6dbccbd1a67270ef04cf693c3abd3a054ff68548e4235266acb41182b0907df079ba99e0b461afc6f320e1b3b923f
7
+ data.tar.gz: e19986fa3ee2298dd6ed3d00f300e5ce25b956562cf6609b27fb976b9acc5df6e6f3ddcf22926de76cd9d9eb97d6d95d05d8c281dc4df0a53ec27b81a16552dd
data/HISTORY CHANGED
@@ -1,5 +1,11 @@
1
1
  = Release History
2
2
 
3
+ == 3.2.2 / 2022-01-15
4
+ * Switch to Github actions for CI/CD (Greg)
5
+ * Test fixes (Greg, Sergio Durigan Junior)
6
+ * Fix typo on test/test_sax_parser.rb (Sergio Durigan Junior)
7
+ * Update homepage in gemspec (Pirate Praveen Arimbrathodiyil)
8
+
3
9
  == 3.2.1 / 2020-11-05
4
10
 
5
11
  * Fix incorrect handling of encodings when using XMLWriter.io (Charlie Savage)
data/Rakefile CHANGED
@@ -16,21 +16,29 @@ spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
16
16
  task :default => [:test]
17
17
 
18
18
  # Setup compile tasks
19
- if RUBY_PLATFORM.match(/mswin32|mswin64|mingw32/)
20
- Rake::ExtensionTask.new do |ext|
21
- ext.gem_spec = spec
22
- ext.name = SO_NAME
23
- ext.ext_dir = "ext/libxml"
24
- ext.lib_dir = "lib/#{RUBY_VERSION.sub(/\.\d$/, '')}"
25
- ext.config_options << "--with-xml2-include=C:/msys64/mingw64/include/libxml2"
26
- end
27
- else
28
- Rake::ExtensionTask.new do |ext|
29
- ext.gem_spec = spec
30
- ext.name = SO_NAME
31
- ext.ext_dir = "ext/libxml"
32
- ext.lib_dir = "lib/#{RUBY_VERSION.sub(/\.\d$/, '')}"
33
- ext.config_options << "--with-xml2-include=/usr/include/libxml2"
19
+ Rake::ExtensionTask.new do |ext|
20
+ ext.gem_spec = spec
21
+ ext.name = SO_NAME
22
+ ext.ext_dir = "ext/libxml"
23
+ ext.lib_dir = "lib/#{RUBY_VERSION.sub(/\.\d$/, '')}"
24
+ if RUBY_PLATFORM.match(/mswin32|mswin64|mingw32|ucrt/)
25
+ ext.config_options <<
26
+ if (dir = ENV['WINDOWS_XML2_INCLUDE'])
27
+ "--with-xml2-include=#{dir}"
28
+ else
29
+ case RUBY_PLATFORM
30
+ when 'i386-mingw32'
31
+ '--with-xml2-include=C:/msys64/mingw32/include/libxml2'
32
+ when 'x64-mingw32'
33
+ '--with-xml2-include=C:/msys64/mingw64/include/libxml2'
34
+ when 'x64-mingw-ucrt'
35
+ '--with-xml2-include=C:/msys64/ucrt64/include/libxml2'
36
+ else
37
+ raise "Unknown Windows Ruby, please set ENV['WINDOWS_XML2_INCLUDE']"
38
+ end
39
+ end
40
+ else
41
+ ext.config_options << '--with-xml2-include=/usr/include/libxml2'
34
42
  end
35
43
  end
36
44
 
@@ -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 "3.2.1"
4
+ #define RUBY_LIBXML_VERSION "3.2.2"
5
5
  #define RUBY_LIBXML_VERNUM 321
6
6
  #define RUBY_LIBXML_VER_MAJ 3
7
7
  #define RUBY_LIBXML_VER_MIN 2
8
- #define RUBY_LIBXML_VER_MIC 1
8
+ #define RUBY_LIBXML_VER_MIC 2
9
9
  #define RUBY_LIBXML_VER_PATCH 0
data/libxml-ruby.gemspec CHANGED
@@ -7,7 +7,7 @@ version = File.read('ext/libxml/ruby_xml_version.h').match(/\s*RUBY_LIBXML_VERSI
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'libxml-ruby'
9
9
  spec.version = version
10
- spec.homepage = 'http://xml4r.github.com/libxml-ruby'
10
+ spec.homepage = 'https://xml4r.github.io/libxml-ruby/'
11
11
  spec.summary = 'Ruby Bindings for LibXML2'
12
12
  spec.description = <<-EOS
13
13
  The Libxml-Ruby project provides Ruby language bindings for the GNOME
@@ -126,6 +126,7 @@ class TestDocument < Minitest::Test
126
126
  def test_nonet
127
127
  xml_string = '<ruby_array uga="booga" foo="bar"><fixnum>one</fixnum><fixnum>two</fixnum></ruby_array>'
128
128
  xml = LibXML::XML::Document.string(xml_string, options: LibXML::XML::Parser::Options::NONET)
129
- schema_document = LibXML::XML::Document.file('d:/src/libxml-ruby/test/model/atom.xml', options: LibXML::XML::Parser::Options::NONET)
129
+ file = File.join(File.dirname(__FILE__), 'model/atom.xml')
130
+ schema_document = LibXML::XML::Document.file(file, options: LibXML::XML::Parser::Options::NONET)
130
131
  end
131
132
  end
data/test/test_dtd.rb CHANGED
@@ -84,7 +84,8 @@ class TestDtd < Minitest::Test
84
84
  assert_nil(error.file)
85
85
  assert_nil(error.line)
86
86
  assert_equal('invalid', error.str1)
87
- assert_nil(error.str2)
87
+ # Different answers across operating systems
88
+ # assert_nil(error.str2)
88
89
  assert_nil(error.str3)
89
90
  assert_equal(0, error.int1)
90
91
  assert_equal(0, error.int2)
data/test/test_helper.rb CHANGED
@@ -5,3 +5,5 @@
5
5
  require 'bundler/setup'
6
6
  require 'minitest/autorun'
7
7
  require 'libxml-ruby'
8
+
9
+ STDOUT.write "\nlibxml2: #{LibXML::XML::LIBXML_VERSION}\n#{RUBY_DESCRIPTION}\n\n"
data/test/test_parser.rb CHANGED
@@ -271,7 +271,7 @@ class TestParser < Minitest::Test
271
271
  assert_equal('foz', error.str2)
272
272
  assert_nil(error.str3)
273
273
  assert_equal(1, error.int1)
274
- assert_equal(20, error.int2)
274
+ assert([18, 20].include?(error.int2))
275
275
  assert_nil(error.node)
276
276
  end
277
277
 
@@ -127,12 +127,6 @@ class TestParserContext < Minitest::Test
127
127
  end
128
128
  end
129
129
 
130
- if ENV['NOTWORKING']
131
- def test_num_chars
132
- assert_equal(17, context.num_chars)
133
- end
134
- end
135
-
136
130
  def test_replace_entities
137
131
  context = LibXML::XML::Parser::Context.new
138
132
  assert(!context.replace_entities?)
@@ -185,7 +179,7 @@ class TestParserContext < Minitest::Test
185
179
  assert_nil(context.name_node)
186
180
  assert_equal(0, context.name_depth)
187
181
  assert_equal(10, context.name_depth_max)
188
- assert_equal(17, context.num_chars)
182
+ assert([0, 17].include?(context.num_chars))
189
183
  assert_equal(false, context.replace_entities?)
190
184
  assert_equal(1, context.space_depth)
191
185
  assert_equal(10, context.space_depth_max)
data/test/test_reader.rb CHANGED
@@ -249,9 +249,10 @@ class TestReader < Minitest::Test
249
249
  end
250
250
 
251
251
  def test_bytes_consumed
252
+ ending_are_rn = File.binread(XML_FILE).include? "\r\n"
252
253
  reader = LibXML::XML::Reader.file(XML_FILE)
253
254
  reader.read
254
- assert_equal(428, reader.byte_consumed)
255
+ assert_equal(ending_are_rn ? 428 : 416, reader.byte_consumed)
255
256
  end
256
257
 
257
258
  def test_node
@@ -181,7 +181,7 @@ class TestSaxParser < Minitest::Test
181
181
  xml = File.read(saxtest_file)
182
182
  io = StringIO.new(xml)
183
183
  parser = LibXML::XML::SaxParser.io(io)
184
-
184
+
185
185
  parser.callbacks = TestCaseCallbacks.new
186
186
  parser.parse
187
187
  verify(parser)
@@ -250,25 +250,32 @@ EOS
250
250
  result = parser.callbacks.result
251
251
 
252
252
  i = -1
253
+
254
+ base_err_msg = "Fatal error: (Premature end of data in tag Results line 1|EndTag: '<\\/' not found) at :2\\."
255
+ re_err_msg1 = /\A(error: )#{base_err_msg}\z/
256
+ re_err_msg2 = /\A#{base_err_msg}\z/
257
+
253
258
  assert_equal("startdoc", result[i+=1])
254
259
  assert_equal("start_element: Results, attr: {}", result[i+=1])
255
260
  assert_equal("start_element_ns: Results, attr: {}, prefix: , uri: , ns: {}", result[i+=1])
256
261
  assert_equal("characters: \n", result[i+=1])
257
- assert_equal("error: Fatal error: EndTag: '</' not found at :2.", result[i+=1])
262
+ assert_match(re_err_msg1, result[i+=1])
258
263
  assert_equal("end_document", result[i+=1])
259
264
 
260
265
  refute_nil(error)
261
266
  assert_kind_of(LibXML::XML::Error, error)
262
- assert_equal("Fatal error: EndTag: '</' not found at :2.", error.message)
267
+ assert_match(re_err_msg2, error.message)
263
268
  assert_equal(LibXML::XML::Error::PARSER, error.domain)
264
- assert_equal(LibXML::XML::Error::LTSLASH_REQUIRED, error.code)
269
+
270
+ assert([LibXML::XML::Error::TAG_NOT_FINISHED, LibXML::XML::Error::LTSLASH_REQUIRED].include?(error.code))
265
271
  assert_equal(LibXML::XML::Error::FATAL, error.level)
266
272
  assert_nil(error.file)
267
273
  assert_equal(2, error.line)
268
- assert_nil(error.str1)
274
+ # Sometimes this is nil and sometimes its not depending on OS and libxlm version
275
+ # assert_nil(error.str1)
269
276
  assert_nil(error.str2)
270
277
  assert_nil(error.str3)
271
- assert_equal(0, error.int1)
278
+ assert([0, 1].include?(error.int1))
272
279
  assert_equal(1, error.int2)
273
280
  assert_nil(error.node)
274
281
  end
data/test/test_xml.rb CHANGED
@@ -183,7 +183,8 @@ class TestXml < Minitest::Test
183
183
  end
184
184
 
185
185
  def test_enabled_iconv
186
- assert(LibXML::XML.enabled_iconv?)
186
+ iconv_enabled = RUBY_PLATFORM !~ /darwin/
187
+ assert_equal(iconv_enabled, LibXML::XML.enabled_iconv?)
187
188
  end
188
189
 
189
190
  def test_enabled_memory_debug
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: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Bamform
@@ -11,10 +11,10 @@ authors:
11
11
  - Anurag Priyam
12
12
  - Charlie Savage
13
13
  - Ryan Johnson
14
- autorequire:
14
+ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2020-11-05 00:00:00.000000000 Z
17
+ date: 2022-01-15 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rake-compiler
@@ -50,7 +50,7 @@ description: |2
50
50
  Libxml-ruby's primary advantage over REXML is performance - if speed
51
51
  is your need, these are good libraries to consider, as demonstrated
52
52
  by the informal benchmark below.
53
- email:
53
+ email:
54
54
  executables: []
55
55
  extensions:
56
56
  - ext/libxml/extconf.rb
@@ -61,7 +61,6 @@ files:
61
61
  - MANIFEST
62
62
  - README.rdoc
63
63
  - Rakefile
64
- - ext/libxml/extconf.h
65
64
  - ext/libxml/extconf.rb
66
65
  - ext/libxml/libxml.c
67
66
  - ext/libxml/libxml_ruby.def
@@ -218,7 +217,6 @@ files:
218
217
  - test/model/shiporder.xsd
219
218
  - test/model/soap.xml
220
219
  - test/model/xinclude.xml
221
- - test/test.xml
222
220
  - test/test_attr.rb
223
221
  - test/test_attr_decl.rb
224
222
  - test/test_attributes.rb
@@ -260,11 +258,11 @@ files:
260
258
  - test/test_xpath_context.rb
261
259
  - test/test_xpath_expression.rb
262
260
  - test/test_xpointer.rb
263
- homepage: http://xml4r.github.com/libxml-ruby
261
+ homepage: https://xml4r.github.io/libxml-ruby/
264
262
  licenses:
265
263
  - MIT
266
264
  metadata: {}
267
- post_install_message:
265
+ post_install_message:
268
266
  rdoc_options: []
269
267
  require_paths:
270
268
  - lib
@@ -279,14 +277,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
277
  - !ruby/object:Gem::Version
280
278
  version: '0'
281
279
  requirements: []
282
- rubygems_version: 3.1.4
283
- signing_key:
280
+ rubygems_version: 3.3.4
281
+ signing_key:
284
282
  specification_version: 4
285
283
  summary: Ruby Bindings for LibXML2
286
284
  test_files:
287
285
  - test/test_attr.rb
288
- - test/test_attributes.rb
289
286
  - test/test_attr_decl.rb
287
+ - test/test_attributes.rb
290
288
  - test/test_canonicalize.rb
291
289
  - test/test_deprecated_require.rb
292
290
  - test/test_document.rb
data/ext/libxml/extconf.h DELETED
@@ -1,3 +0,0 @@
1
- #ifndef EXTCONF_H
2
- #define EXTCONF_H
3
- #endif
data/test/test.xml DELETED
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Name>François</Name>