libxml-ruby 5.0.4-x64-mingw-ucrt → 5.0.6-x64-mingw-ucrt

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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY +17 -6
  3. data/README.rdoc +1 -1
  4. data/Rakefile +98 -98
  5. data/ext/libxml/extconf.h +1 -0
  6. data/ext/libxml/extconf.rb +5 -0
  7. data/ext/libxml/libxml.c +79 -79
  8. data/ext/libxml/ruby_xml.c +556 -556
  9. data/ext/libxml/ruby_xml_attr.c +333 -333
  10. data/ext/libxml/ruby_xml_attr.h +12 -12
  11. data/ext/libxml/ruby_xml_attr_decl.h +11 -11
  12. data/ext/libxml/ruby_xml_attributes.h +17 -17
  13. data/ext/libxml/ruby_xml_cbg.c +85 -85
  14. data/ext/libxml/ruby_xml_document.c +1129 -1129
  15. data/ext/libxml/ruby_xml_dtd.c +257 -257
  16. data/ext/libxml/ruby_xml_dtd.h +9 -9
  17. data/ext/libxml/ruby_xml_encoding.c +250 -250
  18. data/ext/libxml/ruby_xml_error.c +1003 -1003
  19. data/ext/libxml/ruby_xml_error.h +14 -14
  20. data/ext/libxml/ruby_xml_html_parser.c +91 -91
  21. data/ext/libxml/ruby_xml_html_parser.h +10 -10
  22. data/ext/libxml/ruby_xml_html_parser_context.c +351 -351
  23. data/ext/libxml/ruby_xml_html_parser_context.h +10 -10
  24. data/ext/libxml/ruby_xml_html_parser_options.c +48 -48
  25. data/ext/libxml/ruby_xml_html_parser_options.h +10 -10
  26. data/ext/libxml/ruby_xml_input_cbg.c +188 -188
  27. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  28. data/ext/libxml/ruby_xml_io.c +47 -47
  29. data/ext/libxml/ruby_xml_io.h +10 -10
  30. data/ext/libxml/ruby_xml_namespace.c +151 -151
  31. data/ext/libxml/ruby_xml_namespace.h +10 -10
  32. data/ext/libxml/ruby_xml_namespaces.c +293 -293
  33. data/ext/libxml/ruby_xml_namespaces.h +9 -9
  34. data/ext/libxml/ruby_xml_node.h +13 -13
  35. data/ext/libxml/ruby_xml_parser.c +91 -91
  36. data/ext/libxml/ruby_xml_parser.h +10 -10
  37. data/ext/libxml/ruby_xml_parser_context.c +1009 -1009
  38. data/ext/libxml/ruby_xml_parser_context.h +10 -10
  39. data/ext/libxml/ruby_xml_parser_options.c +74 -74
  40. data/ext/libxml/ruby_xml_parser_options.h +10 -10
  41. data/ext/libxml/ruby_xml_reader.h +14 -14
  42. data/ext/libxml/ruby_xml_relaxng.h +8 -8
  43. data/ext/libxml/ruby_xml_sax2_handler.c +326 -326
  44. data/ext/libxml/ruby_xml_sax2_handler.h +10 -10
  45. data/ext/libxml/ruby_xml_sax_parser.c +108 -108
  46. data/ext/libxml/ruby_xml_sax_parser.h +10 -10
  47. data/ext/libxml/ruby_xml_schema.h +25 -25
  48. data/ext/libxml/ruby_xml_schema_attribute.h +37 -37
  49. data/ext/libxml/ruby_xml_schema_element.h +11 -11
  50. data/ext/libxml/ruby_xml_schema_facet.c +50 -50
  51. data/ext/libxml/ruby_xml_schema_facet.h +9 -9
  52. data/ext/libxml/ruby_xml_schema_type.h +9 -9
  53. data/ext/libxml/ruby_xml_version.h +9 -9
  54. data/ext/libxml/ruby_xml_writer.c +1124 -1124
  55. data/ext/libxml/ruby_xml_writer.h +6 -6
  56. data/ext/libxml/ruby_xml_xinclude.c +20 -20
  57. data/ext/libxml/ruby_xml_xinclude.h +11 -11
  58. data/ext/libxml/ruby_xml_xpath.c +195 -195
  59. data/ext/libxml/ruby_xml_xpath.h +15 -15
  60. data/ext/libxml/ruby_xml_xpath_context.c +362 -362
  61. data/ext/libxml/ruby_xml_xpath_context.h +9 -9
  62. data/ext/libxml/ruby_xml_xpath_expression.h +10 -10
  63. data/ext/libxml/ruby_xml_xpath_object.h +17 -17
  64. data/lib/{3.4 → 4.0}/libxml_ruby.so +0 -0
  65. data/lib/libxml/attr.rb +122 -122
  66. data/lib/libxml/attr_decl.rb +80 -80
  67. data/lib/libxml/attributes.rb +13 -13
  68. data/lib/libxml/document.rb +194 -194
  69. data/lib/libxml/error.rb +95 -95
  70. data/lib/libxml/hpricot.rb +77 -77
  71. data/lib/libxml/html_parser.rb +96 -96
  72. data/lib/libxml/namespace.rb +61 -61
  73. data/lib/libxml/namespaces.rb +37 -37
  74. data/lib/libxml/node.rb +323 -323
  75. data/lib/libxml/parser.rb +102 -102
  76. data/lib/libxml/sax_callbacks.rb +179 -179
  77. data/lib/libxml/sax_parser.rb +40 -40
  78. data/lib/libxml/tree.rb +28 -28
  79. data/lib/libxml-ruby.rb +2 -2
  80. data/lib/libxml.rb +4 -4
  81. data/lib/xml/libxml.rb +10 -10
  82. data/lib/xml.rb +13 -13
  83. data/libxml-ruby.gemspec +50 -49
  84. data/test/test_document.rb +140 -140
  85. data/test/test_document_write.rb +142 -142
  86. data/test/test_dtd.rb +126 -126
  87. data/test/test_encoding.rb +126 -126
  88. data/test/test_error.rb +197 -194
  89. data/test/test_helper.rb +21 -20
  90. data/test/test_namespace.rb +58 -58
  91. data/test/test_node.rb +235 -235
  92. data/test/test_node_write.rb +93 -93
  93. data/test/test_parser.rb +333 -333
  94. data/test/test_reader.rb +364 -364
  95. data/test/test_writer.rb +500 -468
  96. data/test/test_xml.rb +168 -168
  97. metadata +6 -8
  98. data/lib/3.2/libxml_ruby.so +0 -0
  99. data/lib/3.3/libxml_ruby.so +0 -0
  100. data/test/test.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 317e50c28aaefa2f7f3854bc382ab2c90c53a4702610c5157ca15fd2d22a96fd
4
- data.tar.gz: 2ac29d181d347dc4fbbb526d95ae28b91d84ba203179d10aad80b7592bb19ba1
3
+ metadata.gz: 8e8eb473b344e8031f4c70e9209b31209a2121b45e7e9eae4a6d56d23722b702
4
+ data.tar.gz: 7e34c77fc085a28c4feef0dad161b6d30e4a21b4794a40aeec1ff3cf56574c35
5
5
  SHA512:
6
- metadata.gz: 95fa8da4a77bd6ad65a48ed36204a21ac9b72060273e6559a71e2e965518306127851ee0c7069f0a2be51de679631bbbdb8f56b75178cc7f51db12bc2e5c7aee
7
- data.tar.gz: 12f5fb6ffacc7a67dfe80cb6a11daf62717eb3a120c2e1245b2966120279e36dbb059cee7836cf0994c7982eb1c953ada54aaecddb3a46c2b2b0812bfa8c3a2f
6
+ metadata.gz: edf58f135a6018fb975360b05f4edfd5091393cc3a9afe46cc03a3ef7b187674be8c2eaaf37419887ca706b4dbdc59eb3f5890cf2dab036549e2cdefddb2096b
7
+ data.tar.gz: 48249815de2f5163958655b5c0f75ee2d1c86da57f4450f8498ae5943e5cdb49266aafde1e9713174536accc9a5ebf28d4c11e4f045dfd4481725b8282a021b4
data/HISTORY CHANGED
@@ -1,15 +1,26 @@
1
1
  = Release History
2
2
 
3
- == 5.0.4 / 2025-05-11
3
+ == 5.0.6 / 2026-04-03
4
+ * Test fix - Make the memory leak test threshold more generous to avoid false positives
5
+ * Test fix - Call get_handler on Error class instead of module
6
+ * Fix XML::Writer.string buffer leak
7
+ * Update assertion to comply with minitest deprecations
8
+ * Allow libdir to match Rubies with double digit patch numbers
4
9
 
5
- * Fix compiling with latest libxml version
6
- * Fix compiling with latest C++ compilers
10
+ == 5.0.5 / 2025-07-30
11
+ * Try to fix broken documentation link in Ruby Gems website
12
+ * Update history file
13
+
14
+ == 5.0.4 / 2025-05-12
15
+
16
+ * Fix line ending inconsistencies across platforms
17
+ * Set Git attributes for source files to keep LF line endings.
18
+ * Add optional zlib support detection in extconf
7
19
 
8
20
  == 5.0.3 / 2024-03-12
9
21
 
10
- * Update Xcode and Visual Studio projects
11
- * Fix check for availability of structuredErrorFunc
12
- * Fix #213. Last update was not backwards compatible.
22
+ * Fix compiling against newer libxml versions
23
+ * Fix version check
13
24
 
14
25
  == 5.0.2 / 2024-01-08
15
26
 
data/README.rdoc CHANGED
@@ -89,7 +89,7 @@ the {libxslt gem}[https://github.com/xml4r/libxslt-rubygem].
89
89
 
90
90
  == Usage
91
91
  For information about using libxml-ruby please refer to its
92
- documentation[http://xml4r.github.io/libxml-ruby]. Some tutorials are also
92
+ documentation[https://xml4r.github.io/libxml-ruby]. Some tutorials are also
93
93
  available[https://github.com/xml4r/libxml-ruby/wiki].
94
94
 
95
95
  All libxml classes are in the LibXML::XML module. The easiest
data/Rakefile CHANGED
@@ -1,99 +1,99 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "rubygems"
4
- require "rake/extensiontask"
5
- require "rake/testtask"
6
- require "rubygems/package_task"
7
- require "rdoc/task"
8
- require "yaml"
9
-
10
- GEM_NAME = "libxml-ruby"
11
- SO_NAME = "libxml_ruby"
12
-
13
- # Read the spec file
14
- spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
15
-
16
- task :default => [:test]
17
-
18
- # Setup compile tasks
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(/mswin|mingw/)
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'
42
- end
43
- end
44
-
45
- # Setup generic gem
46
- Gem::PackageTask.new(spec) do |pkg|
47
- pkg.package_dir = 'pkg'
48
- pkg.need_tar = false
49
- end
50
-
51
- # Setup Windows Gem
52
- if RUBY_PLATFORM.match(/mswin|mingw/)
53
- binaries = (FileList['lib/**/*.so',
54
- 'lib/**/*dll'])
55
-
56
- # Windows specification
57
- win_spec = spec.clone
58
- win_spec.platform = Gem::Platform::CURRENT
59
- win_spec.files += binaries.to_a
60
- win_spec.instance_variable_set(:@cache_file, nil)
61
-
62
- # Unset extensions
63
- win_spec.extensions = nil
64
-
65
- # Rake task to build the windows package
66
- Gem::PackageTask.new(win_spec) do |pkg|
67
- pkg.package_dir = 'pkg'
68
- pkg.need_tar = false
69
- end
70
- end
71
-
72
- # RDoc Task
73
- desc 'Generate rdoc documentation'
74
- RDoc::Task.new("rdoc") do |rdoc|
75
- rdoc.rdoc_dir = 'rdoc'
76
- rdoc.title = 'LibXML'
77
- rdoc.generator = 'hanna'
78
-
79
- # Show source inline with line numbers
80
- rdoc.options << '--line-numbers'
81
- rdoc.options << '--charset=utf-8'
82
- # Make the readme file the start page for the generated html
83
- rdoc.main = 'README.rdoc'
84
- rdoc.rdoc_files.include('doc/*.rdoc',
85
- 'ext/**/libxml.c',
86
- 'ext/**/ruby_xml.c',
87
- 'ext/**/*.c',
88
- 'lib/**/*.rb',
89
- 'README.rdoc',
90
- 'HISTORY',
91
- 'LICENSE')
92
- end
93
-
94
- # Test Task
95
- Rake::TestTask.new do |t|
96
- t.libs << "test"
97
- t.test_files = FileList['test/test*.rb'] - ['test/test_suite.rb']
98
- t.verbose = true
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "rake/extensiontask"
5
+ require "rake/testtask"
6
+ require "rubygems/package_task"
7
+ require "rdoc/task"
8
+ require "yaml"
9
+
10
+ GEM_NAME = "libxml-ruby"
11
+ SO_NAME = "libxml_ruby"
12
+
13
+ # Read the spec file
14
+ spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
15
+
16
+ task :default => [:test]
17
+
18
+ # Setup compile tasks
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(/mingw/)
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'
42
+ end
43
+ end
44
+
45
+ # Setup generic gem
46
+ Gem::PackageTask.new(spec) do |pkg|
47
+ pkg.package_dir = 'pkg'
48
+ pkg.need_tar = false
49
+ end
50
+
51
+ # Setup Windows Gem
52
+ if RUBY_PLATFORM.match(/mswin|mingw/)
53
+ binaries = (FileList['lib/**/*.so',
54
+ 'lib/**/*dll'])
55
+
56
+ # Windows specification
57
+ win_spec = spec.clone
58
+ win_spec.platform = Gem::Platform::CURRENT
59
+ win_spec.files += binaries.to_a
60
+ win_spec.instance_variable_set(:@cache_file, nil)
61
+
62
+ # Unset extensions
63
+ win_spec.extensions = nil
64
+
65
+ # Rake task to build the windows package
66
+ Gem::PackageTask.new(win_spec) do |pkg|
67
+ pkg.package_dir = 'pkg'
68
+ pkg.need_tar = false
69
+ end
70
+ end
71
+
72
+ # RDoc Task
73
+ desc 'Generate rdoc documentation'
74
+ RDoc::Task.new("rdoc") do |rdoc|
75
+ rdoc.rdoc_dir = 'rdoc'
76
+ rdoc.title = 'LibXML'
77
+ rdoc.generator = 'hanna'
78
+
79
+ # Show source inline with line numbers
80
+ rdoc.options << '--line-numbers'
81
+ rdoc.options << '--charset=utf-8'
82
+ # Make the readme file the start page for the generated html
83
+ rdoc.main = 'README.rdoc'
84
+ rdoc.rdoc_files.include('doc/*.rdoc',
85
+ 'ext/**/libxml.c',
86
+ 'ext/**/ruby_xml.c',
87
+ 'ext/**/*.c',
88
+ 'lib/**/*.rb',
89
+ 'README.rdoc',
90
+ 'HISTORY',
91
+ 'LICENSE')
92
+ end
93
+
94
+ # Test Task
95
+ Rake::TestTask.new do |t|
96
+ t.libs << "test"
97
+ t.test_files = FileList['test/test*.rb'] - ['test/test_suite.rb']
98
+ t.verbose = true
99
99
  end
data/ext/libxml/extconf.h CHANGED
@@ -1,3 +1,4 @@
1
1
  #ifndef EXTCONF_H
2
2
  #define EXTCONF_H
3
+ #define HAVE_ZLIB_H 1
3
4
  #endif
@@ -63,5 +63,10 @@ if !found_header || !found_lib
63
63
  EOL
64
64
  end
65
65
 
66
+ # Optional zlib support via libxml2; defines HAVE_ZLIB_H if available.
67
+ unless have_header("zlib.h")
68
+ message "zlib not found: building without compression support\n"
69
+ end
70
+
66
71
  create_header()
67
72
  create_makefile('libxml_ruby')
data/ext/libxml/libxml.c CHANGED
@@ -1,79 +1,79 @@
1
- #include "ruby_libxml.h"
2
-
3
- #if RUBY_INTERN_H
4
- #include <ruby/util.h>
5
- #else
6
- #include <util.h>
7
- #endif
8
-
9
-
10
- VALUE mLibXML;
11
-
12
- static void rxml_init_memory(void)
13
- {
14
- /* Disable for now - broke attributes.
15
- xmlGcMemSetup(
16
- (xmlFreeFunc)ruby_xfree,
17
- (xmlMallocFunc)ruby_xmalloc,
18
- (xmlMallocFunc)ruby_xmalloc,
19
- (xmlReallocFunc)ruby_xrealloc,
20
- (xmlStrdupFunc)ruby_strdup
21
- );*/
22
- }
23
-
24
- void Init_libxml_ruby(void)
25
- {
26
- /* The libxml gem provides Ruby language bindings for GNOME's Libxml2
27
- * XML toolkit. To get started you may:
28
- *
29
- * require 'test_helper'
30
- * document = XML::Document.new
31
- *
32
- * However, when creating an application or library you plan to
33
- * redistribute, it is best to not add the LibXML module to the global
34
- * namespace, in which case you can either write your code like this:
35
- *
36
- * require 'libxml'
37
- * document = LibXML::XML::Document.new
38
- *
39
- * Refer to the README file to get started and the LICENSE file for
40
- * copyright and distribution information.
41
- */
42
-
43
- // Seutp for threading. http://xmlsoft.org/threads.html
44
- xmlInitParser();
45
-
46
- mLibXML = rb_define_module("LibXML");
47
-
48
- rxml_init_memory();
49
- rxml_init_xml();
50
- rxml_init_io();
51
- rxml_init_error();
52
- rxml_init_encoding();
53
- rxml_init_parser();
54
- rxml_init_parser_context();
55
- rxml_init_parser_options();
56
- rxml_init_node();
57
- rxml_init_attributes();
58
- rxml_init_attr();
59
- rxml_init_attr_decl();
60
- rxml_init_document();
61
- rxml_init_namespaces();
62
- rxml_init_namespace();
63
- rxml_init_sax_parser();
64
- rxml_init_sax2_handler();
65
- rxml_init_xinclude();
66
- rxml_init_xpath();
67
- rxml_init_xpath_object();
68
- rxml_init_xpath_context();
69
- rxml_init_xpath_expression();
70
- rxml_init_html_parser();
71
- rxml_init_html_parser_options();
72
- rxml_init_html_parser_context();
73
- rxml_init_input_callbacks();
74
- rxml_init_dtd();
75
- rxml_init_schema();
76
- rxml_init_relaxng();
77
- rxml_init_reader();
78
- rxml_init_writer();
79
- }
1
+ #include "ruby_libxml.h"
2
+
3
+ #if RUBY_INTERN_H
4
+ #include <ruby/util.h>
5
+ #else
6
+ #include <util.h>
7
+ #endif
8
+
9
+
10
+ VALUE mLibXML;
11
+
12
+ static void rxml_init_memory(void)
13
+ {
14
+ /* Disable for now - broke attributes.
15
+ xmlGcMemSetup(
16
+ (xmlFreeFunc)ruby_xfree,
17
+ (xmlMallocFunc)ruby_xmalloc,
18
+ (xmlMallocFunc)ruby_xmalloc,
19
+ (xmlReallocFunc)ruby_xrealloc,
20
+ (xmlStrdupFunc)ruby_strdup
21
+ );*/
22
+ }
23
+
24
+ void Init_libxml_ruby(void)
25
+ {
26
+ /* The libxml gem provides Ruby language bindings for GNOME's Libxml2
27
+ * XML toolkit. To get started you may:
28
+ *
29
+ * require 'test_helper'
30
+ * document = XML::Document.new
31
+ *
32
+ * However, when creating an application or library you plan to
33
+ * redistribute, it is best to not add the LibXML module to the global
34
+ * namespace, in which case you can either write your code like this:
35
+ *
36
+ * require 'libxml'
37
+ * document = LibXML::XML::Document.new
38
+ *
39
+ * Refer to the README file to get started and the LICENSE file for
40
+ * copyright and distribution information.
41
+ */
42
+
43
+ // Seutp for threading. http://xmlsoft.org/threads.html
44
+ xmlInitParser();
45
+
46
+ mLibXML = rb_define_module("LibXML");
47
+
48
+ rxml_init_memory();
49
+ rxml_init_xml();
50
+ rxml_init_io();
51
+ rxml_init_error();
52
+ rxml_init_encoding();
53
+ rxml_init_parser();
54
+ rxml_init_parser_context();
55
+ rxml_init_parser_options();
56
+ rxml_init_node();
57
+ rxml_init_attributes();
58
+ rxml_init_attr();
59
+ rxml_init_attr_decl();
60
+ rxml_init_document();
61
+ rxml_init_namespaces();
62
+ rxml_init_namespace();
63
+ rxml_init_sax_parser();
64
+ rxml_init_sax2_handler();
65
+ rxml_init_xinclude();
66
+ rxml_init_xpath();
67
+ rxml_init_xpath_object();
68
+ rxml_init_xpath_context();
69
+ rxml_init_xpath_expression();
70
+ rxml_init_html_parser();
71
+ rxml_init_html_parser_options();
72
+ rxml_init_html_parser_context();
73
+ rxml_init_input_callbacks();
74
+ rxml_init_dtd();
75
+ rxml_init_schema();
76
+ rxml_init_relaxng();
77
+ rxml_init_reader();
78
+ rxml_init_writer();
79
+ }