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.
- checksums.yaml +4 -4
- data/HISTORY +7 -0
- data/Rakefile +98 -98
- data/ext/libxml/extconf.h +1 -0
- data/ext/libxml/libxml.c +79 -79
- data/ext/libxml/ruby_xml_attr.c +333 -333
- data/ext/libxml/ruby_xml_attr.h +12 -12
- data/ext/libxml/ruby_xml_attr_decl.h +11 -11
- data/ext/libxml/ruby_xml_cbg.c +85 -85
- data/ext/libxml/ruby_xml_dtd.h +9 -9
- data/ext/libxml/ruby_xml_html_parser.c +91 -91
- data/ext/libxml/ruby_xml_html_parser.h +10 -10
- data/ext/libxml/ruby_xml_html_parser_context.h +10 -10
- data/ext/libxml/ruby_xml_html_parser_options.c +48 -48
- data/ext/libxml/ruby_xml_html_parser_options.h +10 -10
- data/ext/libxml/ruby_xml_input_cbg.h +20 -20
- data/ext/libxml/ruby_xml_io.c +47 -47
- data/ext/libxml/ruby_xml_io.h +10 -10
- data/ext/libxml/ruby_xml_namespace.h +10 -10
- data/ext/libxml/ruby_xml_namespaces.c +293 -293
- data/ext/libxml/ruby_xml_namespaces.h +9 -9
- data/ext/libxml/ruby_xml_node.h +13 -13
- data/ext/libxml/ruby_xml_parser.c +91 -91
- data/ext/libxml/ruby_xml_parser_context.h +10 -10
- data/ext/libxml/ruby_xml_reader.h +14 -14
- data/ext/libxml/ruby_xml_relaxng.h +8 -8
- data/ext/libxml/ruby_xml_sax2_handler.h +10 -10
- data/ext/libxml/ruby_xml_sax_parser.h +10 -10
- data/ext/libxml/ruby_xml_schema.h +25 -25
- data/ext/libxml/ruby_xml_schema_attribute.h +37 -37
- data/ext/libxml/ruby_xml_schema_element.h +11 -11
- data/ext/libxml/ruby_xml_schema_facet.c +50 -50
- data/ext/libxml/ruby_xml_schema_facet.h +9 -9
- data/ext/libxml/ruby_xml_schema_type.h +9 -9
- data/ext/libxml/ruby_xml_version.h +2 -2
- data/ext/libxml/ruby_xml_writer.c +1124 -1124
- data/ext/libxml/ruby_xml_writer.h +6 -6
- data/ext/libxml/ruby_xml_xinclude.c +20 -20
- data/ext/libxml/ruby_xml_xinclude.h +11 -11
- data/ext/libxml/ruby_xml_xpath.c +195 -195
- data/ext/libxml/ruby_xml_xpath.h +15 -15
- data/ext/libxml/ruby_xml_xpath_context.c +362 -362
- data/ext/libxml/ruby_xml_xpath_context.h +9 -9
- data/ext/libxml/ruby_xml_xpath_expression.h +10 -10
- data/ext/libxml/ruby_xml_xpath_object.h +17 -17
- data/lib/libxml-ruby.rb +2 -2
- data/test/test_error.rb +5 -2
- data/test/test_helper.rb +1 -0
- data/test/test_writer.rb +500 -468
- metadata +3 -4
- data/test/test.rb +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 177993caa2b415f8cd87badc5cbd163ee50b3e69c73780e619aa9f853d4cd5c4
|
|
4
|
+
data.tar.gz: 77c3750e3b16e32d5ef807c08cf020420d543d1e4c5aa67c0d0d4ff7a3342c20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(/
|
|
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
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
|
+
}
|