libxml-ruby 5.0.5 → 5.0.6

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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY +7 -0
  3. data/Rakefile +98 -98
  4. data/ext/libxml/extconf.h +1 -0
  5. data/ext/libxml/libxml.c +79 -79
  6. data/ext/libxml/ruby_xml_attr.c +333 -333
  7. data/ext/libxml/ruby_xml_attr.h +12 -12
  8. data/ext/libxml/ruby_xml_attr_decl.h +11 -11
  9. data/ext/libxml/ruby_xml_cbg.c +85 -85
  10. data/ext/libxml/ruby_xml_dtd.h +9 -9
  11. data/ext/libxml/ruby_xml_html_parser.c +91 -91
  12. data/ext/libxml/ruby_xml_html_parser.h +10 -10
  13. data/ext/libxml/ruby_xml_html_parser_context.h +10 -10
  14. data/ext/libxml/ruby_xml_html_parser_options.c +48 -48
  15. data/ext/libxml/ruby_xml_html_parser_options.h +10 -10
  16. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  17. data/ext/libxml/ruby_xml_io.c +47 -47
  18. data/ext/libxml/ruby_xml_io.h +10 -10
  19. data/ext/libxml/ruby_xml_namespace.h +10 -10
  20. data/ext/libxml/ruby_xml_namespaces.c +293 -293
  21. data/ext/libxml/ruby_xml_namespaces.h +9 -9
  22. data/ext/libxml/ruby_xml_node.h +13 -13
  23. data/ext/libxml/ruby_xml_parser.c +91 -91
  24. data/ext/libxml/ruby_xml_parser_context.h +10 -10
  25. data/ext/libxml/ruby_xml_reader.h +14 -14
  26. data/ext/libxml/ruby_xml_relaxng.h +8 -8
  27. data/ext/libxml/ruby_xml_sax2_handler.h +10 -10
  28. data/ext/libxml/ruby_xml_sax_parser.h +10 -10
  29. data/ext/libxml/ruby_xml_schema.h +25 -25
  30. data/ext/libxml/ruby_xml_schema_attribute.h +37 -37
  31. data/ext/libxml/ruby_xml_schema_element.h +11 -11
  32. data/ext/libxml/ruby_xml_schema_facet.c +50 -50
  33. data/ext/libxml/ruby_xml_schema_facet.h +9 -9
  34. data/ext/libxml/ruby_xml_schema_type.h +9 -9
  35. data/ext/libxml/ruby_xml_version.h +2 -2
  36. data/ext/libxml/ruby_xml_writer.c +1124 -1124
  37. data/ext/libxml/ruby_xml_writer.h +6 -6
  38. data/ext/libxml/ruby_xml_xinclude.c +20 -20
  39. data/ext/libxml/ruby_xml_xinclude.h +11 -11
  40. data/ext/libxml/ruby_xml_xpath.c +195 -195
  41. data/ext/libxml/ruby_xml_xpath.h +15 -15
  42. data/ext/libxml/ruby_xml_xpath_context.c +362 -362
  43. data/ext/libxml/ruby_xml_xpath_context.h +9 -9
  44. data/ext/libxml/ruby_xml_xpath_expression.h +10 -10
  45. data/ext/libxml/ruby_xml_xpath_object.h +17 -17
  46. data/lib/libxml-ruby.rb +2 -2
  47. data/test/test_error.rb +5 -2
  48. data/test/test_helper.rb +1 -0
  49. data/test/test_writer.rb +500 -468
  50. metadata +3 -4
  51. data/test/test.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 483a897670cac3074667b0675ed2b0b160cfa0b0078225b5d648eecc59316c72
4
- data.tar.gz: dd1fe703e863cebae13a3eec6a5045ab4c8b83c3d5ba0e1ce4345fbe02df2263
3
+ metadata.gz: 177993caa2b415f8cd87badc5cbd163ee50b3e69c73780e619aa9f853d4cd5c4
4
+ data.tar.gz: 77c3750e3b16e32d5ef807c08cf020420d543d1e4c5aa67c0d0d4ff7a3342c20
5
5
  SHA512:
6
- metadata.gz: b89d9ac57ed8bb9e2be60c8e0be69cdb8d8903be6434e7be45bd357189c5bf7bdc2fca825642715408c9778e72011e849f76b08fdbafb5e653a050c0f80526a6
7
- data.tar.gz: 8b2af1d8c25923fcfefb101505230387463aa92914655469595b3ebbd041c36f7c44c5f5d14be21a54978f4ced893f35df929151a8a4b781130dfcaf35bf8e5d
6
+ metadata.gz: ee85bed06c1fa796dd13a918a49e66c9af1ffc611a4ce96ac25d49f0bb092ccbcc8fb665e39bee48a3410c858693702e01e3d10958ba54887a6f674a066718cb
7
+ data.tar.gz: 199f0dc6441ed274e2c4a11a3a76c048140d0d63884e81c787fb3b47720dd042f5aefc6e0185d89da9369f520acb4838dacace482bf20f8fc0c931489302c0cd
data/HISTORY CHANGED
@@ -1,5 +1,12 @@
1
1
  = Release History
2
2
 
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
9
+
3
10
  == 5.0.5 / 2025-07-30
4
11
  * Try to fix broken documentation link in Ruby Gems website
5
12
  * Update history file
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
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
+ }