Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-nokogiri for
openSUSE:Factory checked in at 2024-07-30 11:53:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-nokogiri (Old)
and /work/SRC/openSUSE:Factory/.rubygem-nokogiri.new.1882 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-nokogiri"
Tue Jul 30 11:53:26 2024 rev:69 rq:1190054 version:1.16.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-nokogiri/rubygem-nokogiri.changes
2023-11-29 21:18:40.200614358 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-nokogiri.new.1882/rubygem-nokogiri.changes
2024-07-30 11:53:46.799866715 +0200
@@ -1,0 +2,96 @@
+Sat Jul 27 18:46:12 UTC 2024 - Marcus Rueckert <[email protected]>
+
+- 1.16.6:
+ - update intree libxml2 copy (unused in our build)
+ - update intree zlib copy (unused in our build)
+ - [CRuby] `XML::Reader` sets the `@encoding` instance variable
+ during reading if it is not passed into the initializer.
+ Previously, it would remain `nil`. The behavior of
+ `Reader#encoding` has not changed. This works around changes to
+ how libxml2 reports the encoding used in v2.12.6.
+ - [CRuby] `XML::Reader` defaults the encoding to UTF-8 if it's
+ not specified in either the document or as a method parameter.
+ Previously non-ASCII characters were serialized as NCRs in this
+ case. [#2891] (@flavorjones)
+ - [CRuby] Restored support for compilation by GCC versions
+ earlier than 4.6, which was broken in v1.15.0 (540e9aee).
+ [#3090] (@adfoster-r7)
+ - [CRuby] Patched upstream libxml2 to allow parsing HTML5 in the
+ context of a namespaced node (e.g., foreign content like
+ MathML). [#3112, #3116] (@flavorjones)
+ - [CRuby] Fixed a small memory leak in libgumbo (HTML5 parser)
+ when the maximum tree depth limit is hit. [#3098, #3100]
+ (@stevecheckoway)
+- Drop gcc14-allow-incompatible-pointer-types-for-now.patch
+
+-------------------------------------------------------------------
+Fri Jul 26 12:49:30 UTC 2024 - Marcus Rueckert <[email protected]>
+
+- Added gcc14-allow-incompatible-pointer-types-for-now.patch:
+ gcc 14 errors out on incompatible pointer types
+
+ Allow those until https://github.com/sparklemotion/nokogiri/issues/3295
+ is fixed
+
+-------------------------------------------------------------------
+Tue Jul 9 14:34:25 UTC 2024 - Marcus Rueckert <[email protected]>
+
+- Added only-complain-about-version-diff-if-it-is-older.patch
+ boo#1202053 boo#1213999 boo#1203728
+
+-------------------------------------------------------------------
+Thu Jan 18 16:00:05 UTC 2024 - Marcus Rueckert <[email protected]>
+
+- limit ruby versions to 3.x
+
+-------------------------------------------------------------------
+Thu Jan 18 15:56:29 UTC 2024 - Marcus Rueckert <[email protected]>
+
+- 1.16.0:
+ This release introduces native gem support for Ruby 3.3.
+
+ This release ends support for Ruby 2.7, for which
+ [upstream support ended
2023-03-31](https://www.ruby-lang.org/en/downloads/branches/).
+
+
+ #### Pattern matching
+
+ This version marks _official support_ for the pattern matching
+ API in `XML::Attr`, `XML::Document`, `XML::DocumentFragment`,
+ `XML::Namespace`, `XML::Node`, and `XML::NodeSet` (and their
+ subclasses), originally introduced as an experimental feature in
+ v1.14.0. (@flavorjones)
+
+ Documentation on what can be matched:
+
+ *
[`XML::Attr#deconstruct_keys`](https://nokogiri.org/rdoc/Nokogiri/XML/Attr.html?h=deconstruct#method-i-deconstruct_keys)
+ *
[`XML::Document#deconstruct_keys`](https://nokogiri.org/rdoc/Nokogiri/XML/Document.html?h=deconstruct#method-i-deconstruct_keys)
+ *
[`XML::Namespace#deconstruct_keys`](https://nokogiri.org/rdoc/Nokogiri/XML/Namespace.html?h=deconstruct+namespace#method-i-deconstruct_keys)
+ *
[`XML::Node#deconstruct_keys`](https://nokogiri.org/rdoc/Nokogiri/XML/Node.html?h=deconstruct#method-i-deconstruct_keys)
+ *
[`XML::DocumentFragment#deconstruct`](https://nokogiri.org/rdoc/Nokogiri/XML/DocumentFragment.html?h=deconstruct#method-i-deconstruct)
+ *
[`XML::NodeSet#deconstruct`](https://nokogiri.org/rdoc/Nokogiri/XML/NodeSet.html?h=deconstruct#method-i-deconstruct)
+
+
+ ### Dependencies
+
+ * [CRuby] Vendored libxml2 is updated to v2.12.3 from v2.11.6. (@flavorjones)
+ * https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.0
+ * https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.1
+ * https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.2
+ * https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.3
+
+
+ ### Fixed
+
+ * CSS `nth` pseudo-classes now handle spaces, e.g. `"2n + 1"`. [#3018]
(@fusion2004)
+ * [CRuby] `libgumbo` no longer leaks memory when an incomplete tag is
abandoned by the HTML5 parser. [#3036] (@flavorjones)
+
+
+ ### Removed
+
+ * Removed `Nokogiri::HTML5.get` which was deprecated in v1.12.0. [#2278]
(@flavorjones)
+ * Removed the CSS-to-XPath utility modules `XPathVisitorAlwaysUseBuiltins`
and `XPathVisitorOptimallyUseBuiltins`, which were deprecated in v1.13.0 in
favor of `XPathVisitor` constructor args. [#2403] (@flavorjones)
+ * Removed `XML::Reader#attribute_nodes` which was deprecated in v1.13.8 in
favor of `#attribute_hash`. [#2598, #2599] (@flavorjones)
+ * [CRuby] Removed the `libxml/libxml2_path` key from `VersionInfo`, used in
the past for third-party library integration, in favor of the
`nokogiri/cppflags` and `nokogiri/ldflags` keys. Please note that third-party
library integration is not fully supported and may be deprecated soon, see
#2746 for more context. [#2143] (@flavorjones)
+
+-------------------------------------------------------------------
@@ -664 +760 @@
-Fri Oct 28 05:01:51 UTC 2022 - Stephan Kulow <[email protected]>
+Sat Aug 26 04:32:35 UTC 2023 - Marcus Rueckert <[email protected]>
@@ -666 +762 @@
-updated to version 1.13.9
+- updated to version 1.15.4
@@ -668,0 +765,5 @@
+-------------------------------------------------------------------
+Thu Jun 22 00:08:39 UTC 2023 - Marcus Rueckert <[email protected]>
+
+- updated to version 1.15.2
+ see installed CHANGES.md
@@ -671 +772,24 @@
-Thu Aug 4 13:20:37 UTC 2022 - Stephan Kulow <[email protected]>
+Sun May 14 01:31:08 UTC 2023 - Marcus Rueckert <[email protected]>
+
+- cleanup ruby version restrictions
+
+-------------------------------------------------------------------
+Fri Apr 21 13:29:16 UTC 2023 - Marcus Rueckert <[email protected]>
+
+- updated to version 1.14.3
+ see installed CHANGES.md
+
+-------------------------------------------------------------------
+Thu Feb 23 19:12:16 UTC 2023 - Marcus Rueckert <[email protected]>
+
+- updated to version 1.14.2
+ see installed CHANGES.md
+
+-------------------------------------------------------------------
+Thu Dec 22 10:46:21 UTC 2022 - Marcus Rueckert <[email protected]>
+
+- updated to version 1.13.9
+ see installed CHANGES.md
+
+-------------------------------------------------------------------
+Fri Oct 28 05:01:51 UTC 2022 - Stephan Kulow <[email protected]>
@@ -673 +797 @@
-updated to version 1.13.8
+- updated to version 1.13.9
@@ -675,0 +800,5 @@
+-------------------------------------------------------------------
+Thu Aug 4 13:20:37 UTC 2022 - Stephan Kulow <[email protected]>
+
+- updated to version 1.13.8
+ see installed CHANGES.md
Old:
----
nokogiri-1.15.5.gem
New:
----
nokogiri-1.16.6.gem
only-complain-about-version-diff-if-it-is-older.patch
BETA DEBUG BEGIN:
New:
- Added only-complain-about-version-diff-if-it-is-older.patch
boo#1202053 boo#1213999 boo#1203728
BETA DEBUG END:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-nokogiri.spec ++++++
--- /var/tmp/diff_new_pack.Y96nEF/_old 2024-07-30 11:53:47.375889932 +0200
+++ /var/tmp/diff_new_pack.Y96nEF/_new 2024-07-30 11:53:47.379890093 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-nokogiri
#
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,23 +24,21 @@
#
Name: rubygem-nokogiri
-Version: 1.15.5
+Version: 1.16.6
Release: 0
%define mod_name nokogiri
%define mod_full_name %{mod_name}-%{version}
# MANUAL
-%if 0%{?suse_version} == 1500
-%define rb_build_versions ruby31 ruby27
-%define rb_build_ruby_abis ruby:3.1.0 ruby:2.7.0
-%endif
-BuildRequires: %{rubygem mini_portile2 >= 2.8}
+%define rb_build_versions ruby33
+%define rb_build_ruby_abis ruby:3.3.0
+BuildRequires: %{rubygem mini_portile2 >= 2.8.2}
BuildRequires: %{rubygem openssl}
BuildRequires: %{rubygem pkg-config}
BuildRequires: libxml2-devel >= 2.6.21
BuildRequires: libxslt-devel
# /MANUAL
BuildRequires: ruby-macros >= 5
-BuildRequires: %{rubydevel >= 2.7.0}
+BuildRequires: %{rubydevel >= 3.0.0}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: %{rubygem rdoc > 3.10}
BuildRequires: update-alternatives
@@ -48,6 +46,9 @@
Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: rubygem-nokogiri-rpmlintrc
Source2: gem2rpm.yml
+# MANUAL
+Patch0: only-complain-about-version-diff-if-it-is-older.patch
+# /MANUAL
Summary: Nokogiri (é¸) makes it easy and painless to work with XML and
HTML
License: MIT
PreReq: update-alternatives
@@ -61,6 +62,10 @@
libgumbo, or xerces.
%prep
+%gem_unpack
+%patch -P 0 -p1
+find -type f -print0 | xargs -0 touch -r %{S:0}
+%gem_build
%build
++++++ gem2rpm.yml ++++++
--- /var/tmp/diff_new_pack.Y96nEF/_old 2024-07-30 11:53:47.411891383 +0200
+++ /var/tmp/diff_new_pack.Y96nEF/_new 2024-07-30 11:53:47.415891544 +0200
@@ -16,11 +16,9 @@
# :disable_automatic_rdoc_dep: true
# ## used by gem2rpm
:preamble: |-
- %if 0%{?suse_version} == 1500
- %define rb_build_versions ruby31 ruby27
- %define rb_build_ruby_abis ruby:3.1.0 ruby:2.7.0
- %endif
- BuildRequires: %{rubygem mini_portile2 >= 2.8}
+ %define rb_build_versions ruby33
+ %define rb_build_ruby_abis ruby:3.3.0
+ BuildRequires: %{rubygem mini_portile2 >= 2.8.2}
BuildRequires: %{rubygem openssl}
BuildRequires: %{rubygem pkg-config}
BuildRequires: libxml2-devel >= 2.6.21
@@ -30,6 +28,8 @@
# ## used by gem2rpm
# :patches:
# no-more-mini_portile.patch: -p0
+:patches:
+ only-complain-about-version-diff-if-it-is-older.patch: -p1
:sources:
- rubygem-nokogiri-rpmlintrc
# - foo.desktop
++++++ nokogiri-1.15.5.gem -> nokogiri-1.16.6.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Gemfile new/Gemfile
--- old/Gemfile 2023-11-17 16:30:28.000000000 +0100
+++ new/Gemfile 2024-06-13 15:30:08.000000000 +0200
@@ -5,35 +5,38 @@
gemspec
group :development do
+ # ruby 3.4.0-dev removed some gems from the default set
+ #
+ # TODO: we should be able to remove these as our gem dependencies sort it
out and we pull them in
+ # transitively.
+ gem "mutex_m"
+
# bootstrapping
gem "bundler", "~> 2.3"
- gem "rake", "= 13.0.6"
+ gem "rake", "13.1.0"
# building extensions
- gem "rake-compiler", "= 1.2.1"
- gem "rake-compiler-dock", "= 1.3.0"
-
- # documentation
- gem "hoe-markdown", "= 1.4.0"
+ gem "rake-compiler", "1.2.6"
+ gem "rake-compiler-dock", "1.4.0"
# parser generator
gem "rexical", "= 1.0.7"
# tests
- gem "minitest", "5.18.0"
- gem "minitest-reporters", "1.6.0"
- gem "ruby_memcheck", "1.3.2"
+ gem "minitest", "5.21.2"
+ gem "minitest-parallel_fork", "2.0.0"
+ gem "ruby_memcheck", "2.3.0"
gem "rubyzip", "~> 2.3.2"
gem "simplecov", "= 0.21.2"
# rubocop
if Gem::Requirement.new("~>
3.0").satisfied_by?(Gem::Version.new(RUBY_VERSION))
- gem "rubocop", "1.51.0"
- gem "rubocop-minitest", "0.31.0"
+ gem "rubocop", "1.60.2"
+ gem "rubocop-minitest", "0.34.5"
gem "rubocop-packaging", "0.5.2"
- gem "rubocop-performance", "1.18.0"
+ gem "rubocop-performance", "1.20.2"
gem "rubocop-rake", "= 0.6.0"
- gem "rubocop-shopify", "2.13.0"
+ gem "rubocop-shopify", "2.14.0"
end
end
@@ -41,5 +44,5 @@
# `bundle config set --local without rdoc`
# Then re-run `bundle install`.
group :rdoc do
- gem "rdoc", "6.5.0"
+ gem "rdoc", "6.6.2"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2023-11-17 16:30:28.000000000 +0100
+++ new/README.md 2024-06-13 15:30:08.000000000 +0200
@@ -55,6 +55,7 @@
- The Nokogiri mailing list is active at
https://groups.google.com/group/nokogiri-talk
- Open an issue using the "Help Request" template at
https://github.com/sparklemotion/nokogiri/issues
+- Open a discussion at https://github.com/sparklemotion/nokogiri/discussions
Please do not mail the maintainers at their personal addresses.
@@ -90,6 +91,8 @@
- Updating packaged libraries for non-security-related reasons.
- Dropping support for EOLed Ruby versions. [Some folks find this
objectionable](https://github.com/sparklemotion/nokogiri/issues/1568), but
[SemVer says this is OK if the public API hasn't
changed](https://semver.org/#what-should-i-do-if-i-update-my-own-dependencies-without-changing-the-public-api).
- Backwards-incompatible changes to internal or private methods and constants.
These are detailed in the "Changes" section of each changelog entry.
+- Removal of deprecated methods or parameters, after a generous transition
period; usually when those methods or parameters are rarely-used or dangerous
to the user. Essentially, removals that do not justify a major version bump.
+
`Patch`:
@@ -111,7 +114,7 @@
Requirements:
-- Ruby >= 2.7
+- Ruby >= 3.0
- JRuby >= 9.4.0.0
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/dependencies.yml new/dependencies.yml
--- old/dependencies.yml 2023-11-17 16:30:28.000000000 +0100
+++ new/dependencies.yml 2024-06-13 15:30:08.000000000 +0200
@@ -1,8 +1,8 @@
-
+---
libxml2:
- version: "2.11.6"
- sha256: "c90eee7506764abbe07bb616b82da452529609815aefef423d66ef080eb0c300"
- # sha-256 hash provided in
https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.6.sha256sum
+ version: "2.12.8"
+ sha256: "43ad877b018bc63deb2468d71f95219c2fac196876ef36d1bee51d226173ec93"
+ # sha-256 hash provided in
https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.8.sha256sum
libxslt:
version: "1.1.39"
@@ -10,8 +10,8 @@
# sha-256 hash provided in
https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.39.sha256sum
zlib:
- version: "1.2.13"
- sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30"
+ version: "1.3.1"
+ sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23"
# SHA-256 hash provided on http://zlib.net/
libiconv:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/extconf.rb new/ext/nokogiri/extconf.rb
--- old/ext/nokogiri/extconf.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/extconf.rb 2024-06-13 15:30:08.000000000 +0200
@@ -443,7 +443,7 @@
# We use 'host' to set compiler prefix for cross-compiling. Prefer
host_alias over host. And
# prefer i686 (what external dev tools use) to i386 (what ruby's
configure.ac emits).
recipe.host = RbConfig::CONFIG["host_alias"].empty? ?
RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
- recipe.host = recipe.host.gsub(/i386/, "i686")
+ recipe.host = recipe.host.gsub("i386", "i686")
recipe.target = File.join(PACKAGE_ROOT_DIR, "ports") if cacheable_p
recipe.configure_options << "--libdir=#{File.join(recipe.path, "lib")}"
@@ -651,8 +651,7 @@
append_ldflags(ENV["LDFLAGS"].split) unless ENV["LDFLAGS"].nil?
$LIBS = concat_flags($LIBS, ENV["LIBS"])
-# nokogumbo code uses C90/C99 features, let's make sure older compilers won't
give
-# errors/warnings. see #2302
+# libgumbo uses C90/C99 features, see #2302
append_cflags(["-std=c99", "-Wno-declaration-after-statement"])
# gumbo html5 serialization is slower with O3, let's make sure we use O2
@@ -919,6 +918,7 @@
"--with-c14n",
"--with-debug",
"--with-threads",
+ "--without-tls", # see
https://github.com/sparklemotion/nokogiri/issues/3031
"CPPFLAGS=#{cppflags}",
"CFLAGS=#{cflags}",
]
@@ -1087,7 +1087,6 @@
have_func("xmlRelaxNGSetValidStructuredErrors") # introduced in libxml 2.6.21
have_func("xmlSchemaSetValidStructuredErrors") # introduced in libxml 2.6.23
have_func("xmlSchemaSetParserStructuredErrors") # introduced in libxml 2.6.23
-have_func("rb_gc_location") # introduced in Ruby 2.7
have_func("rb_category_warning") # introduced in Ruby 3.0
other_library_versions_string = OTHER_LIBRARY_VERSIONS.map { |k, v| [k,
v].join(":") }.join(",")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/html4_sax_push_parser.c
new/ext/nokogiri/html4_sax_push_parser.c
--- old/ext/nokogiri/html4_sax_push_parser.c 2023-11-17 16:30:28.000000000
+0100
+++ new/ext/nokogiri/html4_sax_push_parser.c 2024-06-13 15:30:08.000000000
+0200
@@ -32,7 +32,7 @@
if ((status != 0) && !(ctx->options & XML_PARSE_RECOVER)) {
// TODO: there appear to be no tests for this block
- xmlErrorPtr e = xmlCtxtGetLastError(ctx);
+ xmlErrorConstPtr e = xmlCtxtGetLastError(ctx);
Nokogiri_error_raise(NULL, e);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/nokogiri.h new/ext/nokogiri/nokogiri.h
--- old/ext/nokogiri/nokogiri.h 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/nokogiri.h 2024-06-13 15:30:08.000000000 +0200
@@ -66,6 +66,13 @@
#define XMLNS_PREFIX "xmlns"
#define XMLNS_PREFIX_LEN 6 /* including either colon or \0 */
+#ifndef xmlErrorConstPtr
+# if LIBXML_VERSION >= 21200
+# define xmlErrorConstPtr const xmlError *
+# else
+# define xmlErrorConstPtr xmlError *
+# endif
+#endif
#include <ruby.h>
#include <ruby/st.h>
@@ -227,9 +234,9 @@
void
Nokogiri_structured_error_func_save_and_set(libxmlStructuredErrorHandlerState
*handler_state, void *user_data,
xmlStructuredErrorFunc handler);
void Nokogiri_structured_error_func_restore(libxmlStructuredErrorHandlerState
*handler_state);
-VALUE Nokogiri_wrap_xml_syntax_error(xmlErrorPtr error);
-void Nokogiri_error_array_pusher(void *ctx, xmlErrorPtr error);
-NORETURN_DECL void Nokogiri_error_raise(void *ctx, xmlErrorPtr error);
+VALUE Nokogiri_wrap_xml_syntax_error(xmlErrorConstPtr error);
+void Nokogiri_error_array_pusher(void *ctx, xmlErrorConstPtr error);
+NORETURN_DECL void Nokogiri_error_raise(void *ctx, xmlErrorConstPtr error);
void Nokogiri_marshal_xpath_funcall_and_return_values(xmlXPathParserContextPtr
ctx, int nargs, VALUE handler,
const char *function_name) ;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/test_global_handlers.c
new/ext/nokogiri/test_global_handlers.c
--- old/ext/nokogiri/test_global_handlers.c 2023-11-17 16:30:28.000000000
+0100
+++ new/ext/nokogiri/test_global_handlers.c 2024-06-13 15:30:08.000000000
+0200
@@ -3,7 +3,7 @@
static VALUE foreign_error_handler_block = Qnil;
static void
-foreign_error_handler(void *user_data, xmlErrorPtr c_error)
+foreign_error_handler(void *user_data, xmlErrorConstPtr c_error)
{
rb_funcall(foreign_error_handler_block, rb_intern("call"), 0);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_cdata.c new/ext/nokogiri/xml_cdata.c
--- old/ext/nokogiri/xml_cdata.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_cdata.c 2024-06-13 15:30:08.000000000 +0200
@@ -33,8 +33,7 @@
if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlDocument)) {
xmlNodePtr deprecated_node_type_arg;
- // TODO: deprecate allowing Node
- NOKO_WARN_DEPRECATION("Passing a Node as the first parameter to CDATA.new
is deprecated. Please pass a Document instead. This will become an error in a
future release of Nokogiri.");
+ NOKO_WARN_DEPRECATION("Passing a Node as the first parameter to CDATA.new
is deprecated. Please pass a Document instead. This will become an error in
Nokogiri v1.17.0."); // TODO: deprecated in v1.15.3, remove in v1.17.0
Noko_Node_Get_Struct(rb_document, xmlNode, deprecated_node_type_arg);
c_document = deprecated_node_type_arg->doc;
} else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_document.c
new/ext/nokogiri/xml_document.c
--- old/ext/nokogiri/xml_document.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_document.c 2024-06-13 15:30:08.000000000 +0200
@@ -74,8 +74,10 @@
ruby_xfree(doc->_private);
+#if defined(__GNUC__) && __GNUC__ >= 5
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" //
xmlDeregisterNodeDefault is deprecated as of libxml2 2.11.0
+#endif
/*
* libxml-ruby < 3.0.0 uses xmlDeregisterNodeDefault. If the user is using
one of those older
* versions, the registered callback from libxml-ruby will access the
_private pointers set by
@@ -90,7 +92,9 @@
if (xmlDeregisterNodeDefaultValue) {
remove_private((xmlNodePtr)doc);
}
+#if defined(__GNUC__) && __GNUC__ >= 5
#pragma GCC diagnostic pop
+#endif
xmlFreeDoc(doc);
}
@@ -337,7 +341,7 @@
xmlSetStructuredErrorFunc(NULL, NULL);
if (doc == NULL) {
- xmlErrorPtr error;
+ xmlErrorConstPtr error;
xmlFreeDoc(doc);
@@ -383,7 +387,7 @@
xmlSetStructuredErrorFunc(NULL, NULL);
if (doc == NULL) {
- xmlErrorPtr error;
+ xmlErrorConstPtr error;
xmlFreeDoc(doc);
@@ -537,7 +541,7 @@
);
if (NULL == ptr) {
- xmlErrorPtr error = xmlGetLastError();
+ xmlErrorConstPtr error = xmlGetLastError();
if (error) {
rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error));
} else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_namespace.c
new/ext/nokogiri/xml_namespace.c
--- old/ext/nokogiri/xml_namespace.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_namespace.c 2024-06-13 15:30:08.000000000 +0200
@@ -42,7 +42,6 @@
xmlFree(ns);
}
-#ifdef HAVE_RB_GC_LOCATION
static void
_xml_namespace_update_references(void *ptr)
{
@@ -51,9 +50,6 @@
ns->_private = (void *)rb_gc_location((VALUE)ns->_private);
}
}
-#else
-# define _xml_namespace_update_references 0
-#endif
static const rb_data_type_t nokogiri_xml_namespace_type_with_dealloc = {
.wrap_struct_name = "Nokogiri::XML::Namespace#with_dealloc",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_node.c new/ext/nokogiri/xml_node.c
--- old/ext/nokogiri/xml_node.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_node.c 2024-06-13 15:30:08.000000000 +0200
@@ -28,7 +28,6 @@
}
}
-#ifdef HAVE_RB_GC_LOCATION
static void
_xml_node_update_references(void *ptr)
{
@@ -38,9 +37,6 @@
node->_private = (void *)rb_gc_location((VALUE)node->_private);
}
}
-#else
-# define _xml_node_update_references 0
-#endif
static const rb_data_type_t nokogiri_node_type = {
.wrap_struct_name = "Nokogiri::XML::Node",
@@ -961,7 +957,7 @@
* - +new_parent_doc+
* The new node's parent Document. Defaults to the this node's document.
*
- * [Returns] The new Nokgiri::XML::Node
+ * [Returns] The new Nokogiri::XML::Node
*/
static VALUE
duplicate_node(int argc, VALUE *argv, VALUE self)
@@ -2058,8 +2054,7 @@
rb_raise(rb_eArgError, "document must be a Nokogiri::XML::Node");
}
if (!rb_obj_is_kind_of(rb_document_node, cNokogiriXmlDocument)) {
- // TODO: deprecate allowing Node
- NOKO_WARN_DEPRECATION("Passing a Node as the second parameter to Node.new
is deprecated. Please pass a Document instead, or prefer an alternative
constructor like Node#add_child. This will become an error in a future release
of Nokogiri.");
+ NOKO_WARN_DEPRECATION("Passing a Node as the second parameter to Node.new
is deprecated. Please pass a Document instead, or prefer an alternative
constructor like Node#add_child. This will become an error in Nokogiri
v1.17.0."); // TODO: deprecated in v1.13.0, remove in v1.17.0
}
Noko_Node_Get_Struct(rb_document_node, xmlNode, c_document_node);
@@ -2138,7 +2133,7 @@
xmlSetStructuredErrorFunc(NULL, NULL);
if (rcode < 0) {
- xmlErrorPtr error;
+ xmlErrorConstPtr error;
error = xmlGetLastError();
if (error) {
@@ -2174,6 +2169,8 @@
/* Twiddle global variable because of a bug in libxml2.
*
http://git.gnome.org/browse/libxml2/commit/?id=e20fb5a72c83cbfc8e4a8aa3943c6be8febadab7
+ *
+ * TODO: this is fixed, and HTML_PARSE_NOIMPLIED is defined, in libxml2 2.7.7
*/
#ifndef HTML_PARSE_NOIMPLIED
htmlHandleOmittedElem(0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_reader.c
new/ext/nokogiri/xml_reader.c
--- old/ext/nokogiri/xml_reader.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_reader.c 2024-06-13 15:30:08.000000000 +0200
@@ -5,8 +5,14 @@
static void
xml_reader_deallocate(void *data)
{
+ // free the document separately because we _may_ have triggered preservation
by calling
+ // xmlTextReaderCurrentDoc during a read_more.
xmlTextReaderPtr reader = data;
+ xmlDocPtr doc = xmlTextReaderCurrentDoc(reader);
xmlFreeTextReader(reader);
+ if (doc) {
+ xmlFreeDoc(doc);
+ }
}
static const rb_data_type_t xml_reader_type = {
@@ -167,48 +173,6 @@
}
/*
- :call-seq: attribute_nodes() â Array<Nokogiri::XML::Attr>
-
- Get the attributes of the current node as an Array of XML:Attr
-
- â This method is deprecated and unsafe to use. It will be removed in a
future version of Nokogiri.
-
- See related: #attribute_hash, #attributes
- */
-static VALUE
-rb_xml_reader_attribute_nodes(VALUE rb_reader)
-{
- xmlTextReaderPtr c_reader;
- xmlNodePtr c_node;
- VALUE attr_nodes;
- int j;
-
- // TODO: deprecated, remove in Nokogiri v1.15, see
https://github.com/sparklemotion/nokogiri/issues/2598
- // After removal, we can also remove all the "node_has_a_document" special
handling from xml_node.c
- NOKO_WARN_DEPRECATION("Reader#attribute_nodes is deprecated and will be
removed in a future version of Nokogiri. Please use Reader#attribute_hash
instead.");
-
- TypedData_Get_Struct(rb_reader, xmlTextReader, &xml_reader_type, c_reader);
-
- if (! has_attributes(c_reader)) {
- return rb_ary_new() ;
- }
-
- c_node = xmlTextReaderExpand(c_reader);
- if (c_node == NULL) {
- return Qnil;
- }
-
- attr_nodes = noko_xml_node_attrs(c_node);
-
- /* ensure that the Reader won't be GCed as long as a node is referenced */
- for (j = 0 ; j < RARRAY_LEN(attr_nodes) ; j++) {
- rb_iv_set(rb_ary_entry(attr_nodes, j), "@reader", rb_reader);
- }
-
- return attr_nodes;
-}
-
-/*
:call-seq: attribute_hash() â Hash<String â String>
Get the attributes of the current node as a Hash of names and values.
@@ -554,9 +518,10 @@
read_more(VALUE self)
{
xmlTextReaderPtr reader;
- xmlErrorPtr error;
+ xmlErrorConstPtr error;
VALUE error_list;
int ret;
+ xmlDocPtr c_document;
TypedData_Get_Struct(self, xmlTextReader, &xml_reader_type, reader);
@@ -566,6 +531,17 @@
ret = xmlTextReaderRead(reader);
xmlSetStructuredErrorFunc(NULL, NULL);
+ c_document = xmlTextReaderCurrentDoc(reader);
+ if (c_document && c_document->encoding == NULL) {
+ VALUE constructor_encoding = rb_iv_get(self, "@encoding");
+ if (RTEST(constructor_encoding)) {
+ c_document->encoding = xmlStrdup(BAD_CAST
StringValueCStr(constructor_encoding));
+ } else {
+ rb_iv_set(self, "@encoding", NOKOGIRI_STR_NEW2("UTF-8"));
+ c_document->encoding = xmlStrdup(BAD_CAST "UTF-8");
+ }
+ }
+
if (ret == 1) { return self; }
if (ret == 0) { return Qnil; }
@@ -749,15 +725,18 @@
const char *parser_encoding;
VALUE constructor_encoding;
+ TypedData_Get_Struct(rb_reader, xmlTextReader, &xml_reader_type, c_reader);
+ parser_encoding = (const char *)xmlTextReaderConstEncoding(c_reader);
+ if (parser_encoding) {
+ return NOKOGIRI_STR_NEW2(parser_encoding);
+ }
+
constructor_encoding = rb_iv_get(rb_reader, "@encoding");
if (RTEST(constructor_encoding)) {
return constructor_encoding;
}
- TypedData_Get_Struct(rb_reader, xmlTextReader, &xml_reader_type, c_reader);
- parser_encoding = (const char *)xmlTextReaderConstEncoding(c_reader);
- if (parser_encoding == NULL) { return Qnil; }
- return NOKOGIRI_STR_NEW2(parser_encoding);
+ return Qnil;
}
void
@@ -778,7 +757,6 @@
rb_define_method(cNokogiriXmlReader, "attribute", reader_attribute, 1);
rb_define_method(cNokogiriXmlReader, "attribute_at", attribute_at, 1);
rb_define_method(cNokogiriXmlReader, "attribute_count", attribute_count, 0);
- rb_define_method(cNokogiriXmlReader, "attribute_nodes",
rb_xml_reader_attribute_nodes, 0);
rb_define_method(cNokogiriXmlReader, "attribute_hash",
rb_xml_reader_attribute_hash, 0);
rb_define_method(cNokogiriXmlReader, "attributes?", attributes_eh, 0);
rb_define_method(cNokogiriXmlReader, "base_uri", rb_xml_reader_base_uri, 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_relax_ng.c
new/ext/nokogiri/xml_relax_ng.c
--- old/ext/nokogiri/xml_relax_ng.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_relax_ng.c 2024-06-13 15:30:08.000000000 +0200
@@ -93,7 +93,7 @@
xmlRelaxNGFreeParserCtxt(c_parser_context);
if (NULL == c_schema) {
- xmlErrorPtr error = xmlGetLastError();
+ xmlErrorConstPtr error = xmlGetLastError();
if (error) {
Nokogiri_error_raise(NULL, error);
} else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_sax_parser_context.c
new/ext/nokogiri/xml_sax_parser_context.c
--- old/ext/nokogiri/xml_sax_parser_context.c 2023-11-17 16:30:28.000000000
+0100
+++ new/ext/nokogiri/xml_sax_parser_context.c 2024-06-13 15:30:08.000000000
+0200
@@ -59,6 +59,10 @@
(xmlInputReadCallback)noko_io_read,
(xmlInputCloseCallback)noko_io_close,
(void *)io, enc);
+ if (!ctxt) {
+ rb_raise(rb_eRuntimeError, "failed to create xml sax parser context");
+ }
+
if (ctxt->sax) {
xmlFree(ctxt->sax);
ctxt->sax = NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_sax_push_parser.c
new/ext/nokogiri/xml_sax_push_parser.c
--- old/ext/nokogiri/xml_sax_push_parser.c 2023-11-17 16:30:28.000000000
+0100
+++ new/ext/nokogiri/xml_sax_push_parser.c 2024-06-13 15:30:08.000000000
+0200
@@ -59,7 +59,7 @@
if (xmlParseChunk(ctx, chunk, size, Qtrue == _last_chunk ? 1 : 0)) {
if (!(ctx->options & XML_PARSE_RECOVER)) {
- xmlErrorPtr e = xmlCtxtGetLastError(ctx);
+ xmlErrorConstPtr e = xmlCtxtGetLastError(ctx);
Nokogiri_error_raise(NULL, e);
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_schema.c
new/ext/nokogiri/xml_schema.c
--- old/ext/nokogiri/xml_schema.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_schema.c 2024-06-13 15:30:08.000000000 +0200
@@ -146,7 +146,7 @@
xmlSchemaFreeParserCtxt(c_parser_context);
if (NULL == c_schema) {
- xmlErrorPtr error = xmlGetLastError();
+ xmlErrorConstPtr error = xmlGetLastError();
if (error) {
Nokogiri_error_raise(NULL, error);
} else {
@@ -222,8 +222,7 @@
if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlDocument)) {
xmlNodePtr deprecated_node_type_arg;
- // TODO: deprecate allowing Node
- NOKO_WARN_DEPRECATION("Passing a Node as the first parameter to
Schema.from_document is deprecated. Please pass a Document instead. This will
become an error in a future release of Nokogiri.");
+ NOKO_WARN_DEPRECATION("Passing a Node as the first parameter to
Schema.from_document is deprecated. Please pass a Document instead. This will
become an error in Nokogiri v1.17.0."); // TODO: deprecated in v1.15.3, remove
in v1.17.0
Noko_Node_Get_Struct(rb_document, xmlNode, deprecated_node_type_arg);
c_document = deprecated_node_type_arg->doc;
} else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_syntax_error.c
new/ext/nokogiri/xml_syntax_error.c
--- old/ext/nokogiri/xml_syntax_error.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_syntax_error.c 2024-06-13 15:30:08.000000000 +0200
@@ -26,7 +26,7 @@
}
void
-Nokogiri_error_array_pusher(void *ctx, xmlErrorPtr error)
+Nokogiri_error_array_pusher(void *ctx, xmlErrorConstPtr error)
{
VALUE list = (VALUE)ctx;
Check_Type(list, T_ARRAY);
@@ -34,13 +34,13 @@
}
void
-Nokogiri_error_raise(void *ctx, xmlErrorPtr error)
+Nokogiri_error_raise(void *ctx, xmlErrorConstPtr error)
{
rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error));
}
VALUE
-Nokogiri_wrap_xml_syntax_error(xmlErrorPtr error)
+Nokogiri_wrap_xml_syntax_error(xmlErrorConstPtr error)
{
VALUE msg, e, klass;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_text.c new/ext/nokogiri/xml_text.c
--- old/ext/nokogiri/xml_text.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xml_text.c 2024-06-13 15:30:08.000000000 +0200
@@ -28,8 +28,7 @@
if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlDocument)) {
xmlNodePtr deprecated_node_type_arg;
- // TODO: deprecate allowing Node
- NOKO_WARN_DEPRECATION("Passing a Node as the second parameter to Text.new
is deprecated. Please pass a Document instead. This will become an error in a
future release of Nokogiri.");
+ NOKO_WARN_DEPRECATION("Passing a Node as the second parameter to Text.new
is deprecated. Please pass a Document instead. This will become an error in
Nokogiri v1.17.0."); // TODO: deprecated in v1.15.3, remove in v1.17.0
Noko_Node_Get_Struct(rb_document, xmlNode, deprecated_node_type_arg);
c_document = deprecated_node_type_arg->doc;
} else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xml_xpath_context.c
new/ext/nokogiri/xml_xpath_context.c
--- old/ext/nokogiri/xml_xpath_context.c 2023-11-17 16:30:28.000000000
+0100
+++ new/ext/nokogiri/xml_xpath_context.c 2024-06-13 15:30:08.000000000
+0200
@@ -321,11 +321,8 @@
VALUE rb_handler = (VALUE)data;
if (rb_respond_to(rb_handler, rb_intern((const char *)c_name))) {
if (c_ns_uri == NULL) {
- NOKO_WARN_DEPRECATION(
- "A custom XPath or CSS handler function named '%s' is being invoked
without a namespace."
- " Please update your query to reference this function as
'nokogiri:%s'."
- " Invoking custom handler functions without a namespace is deprecated
and support will be removed in a future release of Nokogiri.",
- c_name, c_name);
+ NOKO_WARN_DEPRECATION("A custom XPath or CSS handler function named '%s'
is being invoked without a namespace. Please update your query to reference
this function as 'nokogiri:%s'. Invoking custom handler functions without a
namespace is deprecated and will become an error in Nokogiri v1.17.0.",
+ c_name, c_name); // deprecated in v1.15.0, remove
in v1.17.0
}
return method_caller;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/nokogiri/xslt_stylesheet.c
new/ext/nokogiri/xslt_stylesheet.c
--- old/ext/nokogiri/xslt_stylesheet.c 2023-11-17 16:30:28.000000000 +0100
+++ new/ext/nokogiri/xslt_stylesheet.c 2024-06-13 15:30:08.000000000 +0200
@@ -71,7 +71,12 @@
* call-seq:
* parse_stylesheet_doc(document)
*
- * Parse a stylesheet from +document+.
+ * Parse an XSLT::Stylesheet from +document+.
+ *
+ * [Parameters]
+ * - +document+ (Nokogiri::XML::Document) the document to be parsed.
+ *
+ * [Returns] Nokogiri::XSLT::Stylesheet
*/
static VALUE
parse_stylesheet_doc(VALUE klass, VALUE xmldocobj)
@@ -104,7 +109,7 @@
* call-seq:
* serialize(document)
*
- * Serialize +document+ to an xml string.
+ * Serialize +document+ to an xml string, as specified by the +method+
parameter in the Stylesheet.
*/
static VALUE
rb_xslt_stylesheet_serialize(VALUE self, VALUE xmlobj)
@@ -133,7 +138,7 @@
* transform(document)
* transform(document, params = {})
*
- * Apply an XSLT stylesheet to an XML::Document.
+ * Transform an XML::Document as defined by an XSLT::Stylesheet.
*
* [Parameters]
* - +document+ (Nokogiri::XML::Document) the document to be transformed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gumbo-parser/Makefile new/gumbo-parser/Makefile
--- old/gumbo-parser/Makefile 2023-11-17 16:30:28.000000000 +0100
+++ new/gumbo-parser/Makefile 2024-06-13 15:30:08.000000000 +0200
@@ -13,6 +13,23 @@
all: check
+oss-fuzz:
+ ./fuzzer/build-ossfuzz.sh
+
+fuzzers: fuzzer-normal fuzzer-asan fuzzer-ubsan fuzzer-msan
+
+fuzzer-normal:
+ ./fuzzer/build.sh
+
+fuzzer-asan:
+ SANITIZER=asan ./fuzzer/build.sh
+
+fuzzer-ubsan:
+ SANITIZER=ubsan ./fuzzer/build.sh
+
+fuzzer-msan:
+ SANITIZER=msan ./fuzzer/build.sh
+
# don't try to regenerate ragel or gperf files in CI, that should be a
development-only action and
# the generated files should be committed to SCM
ifneq ($(CI),true)
@@ -81,6 +98,7 @@
clean:
$(RM) -r build
+ $(RM) -r fuzzer/build fuzzer/src-* fuzzer/gumbo_corpus
build/src/flags: | build/src
@echo 'old_CC := $(CC)' > $@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gumbo-parser/src/parser.c
new/gumbo-parser/src/parser.c
--- old/gumbo-parser/src/parser.c 2023-11-17 16:30:28.000000000 +0100
+++ new/gumbo-parser/src/parser.c 2024-06-13 15:30:08.000000000 +0200
@@ -4826,14 +4826,17 @@
// to a token.
if (token.type == GUMBO_TOKEN_END_TAG &&
token.v.end_tag.tag == GUMBO_TAG_UNKNOWN)
+ {
gumbo_free(token.v.end_tag.name);
+ token.v.end_tag.name = NULL;
+ }
+ if (unlikely(state->_open_elements.length > max_tree_depth)) {
+ parser._output->status = GUMBO_STATUS_TREE_TOO_DEEP;
+ gumbo_debug("Tree depth limit exceeded.\n");
+ break;
+ }
}
- if (unlikely(state->_open_elements.length > max_tree_depth)) {
- parser._output->status = GUMBO_STATUS_TREE_TOO_DEEP;
- gumbo_debug("Tree depth limit exceeded.\n");
- break;
- }
++loop_count;
assert(loop_count < 1000000000UL);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/gumbo-parser/src/tokenizer.c
new/gumbo-parser/src/tokenizer.c
--- old/gumbo-parser/src/tokenizer.c 2023-11-17 16:30:28.000000000 +0100
+++ new/gumbo-parser/src/tokenizer.c 2024-06-13 15:30:08.000000000 +0200
@@ -506,6 +506,7 @@
for (unsigned int i = 0; i < tag_state->_attributes.length; ++i) {
gumbo_destroy_attribute(tag_state->_attributes.data[i]);
}
+ gumbo_free(tag_state->_name);
gumbo_free(tag_state->_attributes.data);
mark_tag_state_as_empty(tag_state);
gumbo_string_buffer_destroy(&tag_state->_buffer);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/css/parser_extras.rb
new/lib/nokogiri/css/parser_extras.rb
--- old/lib/nokogiri/css/parser_extras.rb 2023-11-17 16:30:28.000000000
+0100
+++ new/lib/nokogiri/css/parser_extras.rb 2024-06-13 15:30:08.000000000
+0200
@@ -23,7 +23,7 @@
# Get the css selector in +string+ from the cache
def [](string)
- return nil unless cache_on?
+ return unless cache_on?
@mutex.synchronize { @cache[string] }
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/css/xpath_visitor.rb
new/lib/nokogiri/css/xpath_visitor.rb
--- old/lib/nokogiri/css/xpath_visitor.rb 2023-11-17 16:30:28.000000000
+0100
+++ new/lib/nokogiri/css/xpath_visitor.rb 2024-06-13 15:30:08.000000000
+0200
@@ -302,7 +302,7 @@
end
def read_a_and_positive_b(values)
- op = values[2]
+ op = values[2].strip
if op == "+"
a = values[0].to_i
b = values[3].to_i
@@ -335,25 +335,5 @@
end
end
end
-
- module XPathVisitorAlwaysUseBuiltins # :nodoc:
- def self.new
- warn(
- "Nokogiri::CSS::XPathVisitorAlwaysUseBuiltins is deprecated and will
be removed in a future version of Nokogiri",
- { uplevel: 1 },
- )
- XPathVisitor.new(builtins: :always)
- end
- end
-
- module XPathVisitorOptimallyUseBuiltins # :nodoc:
- def self.new
- warn(
- "Nokogiri::CSS::XPathVisitorOptimallyUseBuiltins is deprecated and
will be removed in a future version of Nokogiri",
- { uplevel: 1 },
- )
- XPathVisitor.new(builtins: :optimal)
- end
- end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/html4/document.rb
new/lib/nokogiri/html4/document.rb
--- old/lib/nokogiri/html4/document.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/html4/document.rb 2024-06-13 15:30:08.000000000 +0200
@@ -92,7 +92,7 @@
title = XML::Node.new("title", self) << tnode
if (head = at_xpath("//head"))
head << title
- elsif (meta = (at_xpath("//meta[@charset]") || meta_content_type))
+ elsif (meta = at_xpath("//meta[@charset]") || meta_content_type)
# better put after charset declaration
meta.add_next_sibling(title)
else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/html4/encoding_reader.rb
new/lib/nokogiri/html4/encoding_reader.rb
--- old/lib/nokogiri/html4/encoding_reader.rb 2023-11-17 16:30:28.000000000
+0100
+++ new/lib/nokogiri/html4/encoding_reader.rb 2024-06-13 15:30:08.000000000
+0200
@@ -94,7 +94,7 @@
# no support for a call without len
unless @firstchunk
- (@firstchunk = @io.read(len)) || (return nil)
+ (@firstchunk = @io.read(len)) || return
# This implementation expects that the first call from
# htmlReadIO() is made with a length long enough (~1KB) to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/html5.rb new/lib/nokogiri/html5.rb
--- old/lib/nokogiri/html5.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/html5.rb 2024-06-13 15:30:08.000000000 +0200
@@ -239,23 +239,6 @@
DocumentFragment.parse(string, encoding, options)
end
- # Fetch and parse a HTML document from the web, following redirects,
- # handling https, and determining the character encoding using HTML5
- # rules. +uri+ may be a +String+ or a +URI+. +options+ contains
- # http headers and special options. Everything which is not a
- # special option is considered a header. Special options include:
- # * :follow_limit => number of redirects which are followed
- # * :basic_auth => [username, password]
- def get(uri, options = {})
- # TODO: deprecate
- warn(
- "Nokogiri::HTML5.get is deprecated and will be removed in a future
version of Nokogiri.",
- uplevel: 1,
- category: :deprecated,
- )
- get_impl(uri, options)
- end
-
# :nodoc:
def read_and_encode(string, encoding)
# Read the string with the given encoding.
@@ -283,55 +266,6 @@
private
- def get_impl(uri, options = {})
- headers = options.clone
- headers = { follow_limit: headers } if Numeric === headers # deprecated
- limit = headers[:follow_limit] ? headers.delete(:follow_limit).to_i :
10
-
- require "net/http"
- uri = URI(uri) unless URI === uri
-
- http = Net::HTTP.new(uri.host, uri.port)
-
- # TLS / SSL support
- http.use_ssl = true if uri.scheme == "https"
-
- # Pass through Net::HTTP override values, which currently include:
- # :ca_file, :ca_path, :cert, :cert_store, :ciphers,
- # :close_on_empty_response, :continue_timeout, :key, :open_timeout,
- # :read_timeout, :ssl_timeout, :ssl_version, :use_ssl,
- # :verify_callback, :verify_depth, :verify_mode
- options.each do |key, _value|
- http.send("#{key}=", headers.delete(key)) if
http.respond_to?("#{key}=")
- end
-
- request = Net::HTTP::Get.new(uri.request_uri)
-
- # basic authentication
- auth = headers.delete(:basic_auth)
- auth ||= [uri.user, uri.password] if uri.user && uri.password
- request.basic_auth(auth.first, auth.last) if auth
-
- # remaining options are treated as headers
- headers.each { |key, value| request[key.to_s] = value.to_s }
-
- response = http.request(request)
-
- case response
- when Net::HTTPSuccess
- doc = parse(reencode(response.body, response["content-type"]),
options)
- doc.instance_variable_set(:@response, response)
- doc.class.send(:attr_reader, :response)
- doc
- when Net::HTTPRedirection
- response.value if limit <= 1
- location = URI.join(uri, response["location"])
- get_impl(location, options.merge(follow_limit: limit - 1))
- else
- response.value
- end
- end
-
# Charset sniffing is a complex and controversial topic that
understandably isn't done _by
# default_ by the Ruby Net::HTTP library. This being said, it is a very
real problem for
# consumers of HTML as the default for HTML is iso-8859-1, most "good"
producers use utf-8, and
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/version/constant.rb
new/lib/nokogiri/version/constant.rb
--- old/lib/nokogiri/version/constant.rb 2023-11-17 16:30:28.000000000
+0100
+++ new/lib/nokogiri/version/constant.rb 2024-06-13 15:30:08.000000000
+0200
@@ -2,5 +2,5 @@
module Nokogiri
# The version of Nokogiri you are using
- VERSION = "1.15.5"
+ VERSION = "1.16.6"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/version/info.rb
new/lib/nokogiri/version/info.rb
--- old/lib/nokogiri/version/info.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/version/info.rb 2024-06-13 15:30:08.000000000 +0200
@@ -94,11 +94,14 @@
nokogiri["version"] = Nokogiri::VERSION
unless jruby?
- # enable gems like nokogumbo to build with the following in their
extconf.rb:
+ # enable gems to build against Nokogiri with the following in
their extconf.rb:
#
# append_cflags(Nokogiri::VERSION_INFO["nokogiri"]["cppflags"])
# append_ldflags(Nokogiri::VERSION_INFO["nokogiri"]["ldflags"])
#
+ # though, this won't work on all platform and versions of Ruby,
and won't be supported
+ # forever, see
https://github.com/sparklemotion/nokogiri/discussions/2746 for context.
+ #
cppflags = ["-I#{header_directory.shellescape}"]
ldflags = []
@@ -108,7 +111,8 @@
end
if windows?
- # on windows, nokogumbo needs to link against nokogiri.so to
resolve symbols. see #2167
+ # on windows, third party libraries that wish to link against
nokogiri
+ # should link against nokogiri.so to resolve symbols. see #2167
lib_directory =
File.expand_path(File.join(File.dirname(__FILE__), "../#{ruby_minor}"))
unless File.exist?(lib_directory)
lib_directory =
File.expand_path(File.join(File.dirname(__FILE__), ".."))
@@ -136,9 +140,6 @@
libxml["source"] = "packaged"
libxml["precompiled"] = libxml2_precompiled?
libxml["patches"] = Nokogiri::LIBXML2_PATCHES
-
- # this is for nokogumbo and shouldn't be forever
- libxml["libxml2_path"] = header_directory
else
libxml["source"] = "system"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/attr.rb new/lib/nokogiri/xml/attr.rb
--- old/lib/nokogiri/xml/attr.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xml/attr.rb 2024-06-13 15:30:08.000000000 +0200
@@ -18,8 +18,6 @@
# - +value+ â (String) The value of the attribute.
# - +namespace+ â (Namespace, nil) The Namespace of the attribute, or
+nil+ if there is no namespace.
#
- # â¡ This is an experimental feature, available since v1.14.0
- #
# *Example*
#
# doc = Nokogiri::XML.parse(<<~XML)
@@ -52,6 +50,8 @@
# # href = "http://nokogiri.org/ns/noko"
# # })}
#
+ # Since v1.14.0
+ #
def deconstruct_keys(keys)
{ name: name, value: value, namespace: namespace }
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/document.rb
new/lib/nokogiri/xml/document.rb
--- old/lib/nokogiri/xml/document.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xml/document.rb 2024-06-13 15:30:08.000000000 +0200
@@ -329,7 +329,7 @@
# Validate this Document against it's DTD. Returns a list of errors on
# the document or +nil+ when there is no DTD.
def validate
- return nil unless internal_subset
+ return unless internal_subset
internal_subset.validate(self)
end
@@ -426,8 +426,6 @@
# instructions. If you have a use case and would like this
functionality, please let us know
# by opening an issue or a discussion on the github project.
#
- # â¡ This is an experimental feature, available since v1.14.0
- #
# *Example*
#
# doc = Nokogiri::XML.parse(<<~XML)
@@ -454,6 +452,8 @@
# doc.deconstruct_keys([:root])
# # => {:root=>nil}
#
+ # Since v1.14.0
+ #
def deconstruct_keys(keys)
{ root: root }
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/document_fragment.rb
new/lib/nokogiri/xml/document_fragment.rb
--- old/lib/nokogiri/xml/document_fragment.rb 2023-11-17 16:30:28.000000000
+0100
+++ new/lib/nokogiri/xml/document_fragment.rb 2024-06-13 15:30:08.000000000
+0200
@@ -154,8 +154,6 @@
# root elements, you should deconstruct the array returned by
# <tt>DocumentFragment#elements</tt>.
#
- # â¡ This is an experimental feature, available since v1.14.0
- #
# *Example*
#
# frag = Nokogiri::HTML5.fragment(<<~HTML)
@@ -187,6 +185,8 @@
# # }),
# # #(Element:0x398 { name = "div", children = [ #(Text "End")]
})]
#
+ # Since v1.14.0
+ #
def deconstruct
children.to_a
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/namespace.rb
new/lib/nokogiri/xml/namespace.rb
--- old/lib/nokogiri/xml/namespace.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xml/namespace.rb 2024-06-13 15:30:08.000000000 +0200
@@ -16,8 +16,6 @@
# - +prefix+ â (String, nil) The namespace's prefix, or +nil+ if
there is no prefix (e.g., default namespace).
# - +href+ â (String) The namespace's URI
#
- # â¡ This is an experimental feature, available since v1.14.0
- #
# *Example*
#
# doc = Nokogiri::XML.parse(<<~XML)
@@ -43,6 +41,7 @@
# doc.root.elements.last.namespace.deconstruct_keys([:prefix, :href])
# # => {:prefix=>"noko", :href=>"http://nokogiri.org/ns/noko"}
#
+ # Since v1.14.0
#
def deconstruct_keys(keys)
{ prefix: prefix, href: href }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/node.rb new/lib/nokogiri/xml/node.rb
--- old/lib/nokogiri/xml/node.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xml/node.rb 2024-06-13 15:30:08.000000000 +0200
@@ -1049,29 +1049,35 @@
return Nokogiri::XML::NodeSet.new(document) if contents.empty?
- # libxml2 does not obey the +recover+ option after encountering errors
during +in_context+
- # parsing, and so this horrible hack is here to try to emulate
recovery behavior.
- #
- # Unfortunately, this means we're no longer parsing "in context" and
so namespaces that
- # would have been inherited from the context node won't be handled
correctly. This hack was
- # written in 2010, and I regret it, because it's silently degrading
functionality in a way
- # that's not easily prevented (or even detected).
- #
- # I think preferable behavior would be to either:
- #
- # a. add an error noting that we "fell back" and pointing the user to
turning off the +recover+ option
- # b. don't recover, but raise a sensible exception
- #
- # For context and background:
https://github.com/sparklemotion/nokogiri/issues/313
- # FIXME bug report:
https://github.com/sparklemotion/nokogiri/issues/2092
error_count = document.errors.length
node_set = in_context(contents, options.to_i)
- if node_set.empty? && (document.errors.length > error_count)
- if options.recover?
+ if document.errors.length > error_count
+ raise document.errors[error_count] unless options.recover?
+
+ if node_set.empty?
+ # libxml2 < 2.13 does not obey the +recover+ option after
encountering errors during
+ # +in_context+ parsing, and so this horrible hack is here to try
to emulate recovery
+ # behavior.
+ #
+ # (Note that HTML4 fragment parsing seems to have been fixed in
abd74186, and XML
+ # fragment parsing is fixed in 1c106edf. Both are in 2.13.)
+ #
+ # Unfortunately, this means we're no longer parsing "in context"
and so namespaces that
+ # would have been inherited from the context node won't be handled
correctly. This hack
+ # was written in 2010, and I regret it, because it's silently
degrading functionality in
+ # a way that's not easily prevented (or even detected).
+ #
+ # I think preferable behavior would be to either:
+ #
+ # a. add an error noting that we "fell back" and pointing the user
to turning off the
+ # +recover+ option
+ # b. don't recover, but raise a sensible exception
+ #
+ # For context and background:
+ # - https://github.com/sparklemotion/nokogiri/issues/313
+ # - https://github.com/sparklemotion/nokogiri/issues/2092
fragment =
document.related_class("DocumentFragment").parse(contents)
node_set = fragment.children
- else
- raise document.errors[error_count]
end
end
node_set
@@ -1165,7 +1171,7 @@
# Fetch the Nokogiri::HTML4::ElementDescription for this node. Returns
# nil on XML documents and on unknown tags.
def description
- return nil if document.xml?
+ return if document.xml?
Nokogiri::HTML4::ElementDescription[name]
end
@@ -1254,8 +1260,8 @@
# Compare two Node objects with respect to their Document. Nodes from
# different documents cannot be compared.
def <=>(other)
- return nil unless other.is_a?(Nokogiri::XML::Node)
- return nil unless document == other.document
+ return unless other.is_a?(Nokogiri::XML::Node)
+ return unless document == other.document
compare(other)
end
@@ -1278,6 +1284,7 @@
# end
#
def serialize(*args, &block)
+ # TODO: deprecate non-hash options, see 46c68ed 2009-06-20 for context
options = if args.first.is_a?(Hash)
args.shift
else
@@ -1429,8 +1436,6 @@
# - +content+ â (String) The contents of all the text nodes in this
node's subtree. See #content.
# - +inner_html+ â (String) The inner markup for the children of this
node. See #inner_html.
#
- # â¡ This is an experimental feature, available since v1.14.0
- #
# *Example*
#
# doc = Nokogiri::XML.parse(<<~XML)
@@ -1465,6 +1470,8 @@
# # value = "def"
# # })]}
#
+ # Since v1.14.0
+ #
def deconstruct_keys(keys)
requested_keys = DECONSTRUCT_KEYS & keys
{}.tap do |values|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/node_set.rb
new/lib/nokogiri/xml/node_set.rb
--- old/lib/nokogiri/xml/node_set.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xml/node_set.rb 2024-06-13 15:30:08.000000000 +0200
@@ -372,7 +372,7 @@
# Removes the last element from set and returns it, or +nil+ if
# the set is empty
def pop
- return nil if length == 0
+ return if length == 0
delete(last)
end
@@ -381,7 +381,7 @@
# Returns the first element of the NodeSet and removes it. Returns
# +nil+ if the set is empty.
def shift
- return nil if length == 0
+ return if length == 0
delete(first)
end
@@ -435,7 +435,7 @@
#
# Returns the members of this NodeSet as an array, to use in pattern
matching.
#
- # â¡ This is an experimental feature, available since v1.14.0
+ # Since v1.14.0
#
def deconstruct
to_a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/reader.rb
new/lib/nokogiri/xml/reader.rb
--- old/lib/nokogiri/xml/reader.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xml/reader.rb 2024-06-13 15:30:08.000000000 +0200
@@ -3,9 +3,11 @@
module Nokogiri
module XML
###
- # Nokogiri::XML::Reader parses an XML document similar to the way a cursor
- # would move. The Reader is given an XML document, and yields nodes
- # to an each block.
+ # Nokogiri::XML::Reader parses an XML document similar to the way a cursor
would move. The
+ # Reader is given an XML document, and yields nodes to an each block.
+ #
+ # The Reader parser might be good for when you need the speed and low
memory usage of the SAX
+ # parser, but do not want to write a Document handler.
#
# Here is an example of usage:
#
@@ -22,13 +24,12 @@
#
# end
#
- # Note that Nokogiri::XML::Reader#each can only be called once!! Once
- # the cursor moves through the entire document, you must parse the
- # document again. So make sure that you capture any information you
- # need during the first iteration.
+ # â Nokogiri::XML::Reader#each can only be called once! Once the cursor
moves through the entire
+ # document, you must parse the document again. It may be better to capture
all information you
+ # need during a single iteration.
#
- # The Reader parser is good for when you need the speed of a SAX parser,
- # but do not want to write a Document handler.
+ # â libxml2 does not support error recovery in the Reader parser. The
`RECOVER` ParseOption is
+ # ignored. If a syntax error is encountered during parsing, an exception
will be raised.
class Reader
include Enumerable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/searchable.rb
new/lib/nokogiri/xml/searchable.rb
--- old/lib/nokogiri/xml/searchable.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xml/searchable.rb 2024-06-13 15:30:08.000000000 +0200
@@ -199,7 +199,7 @@
#
# Search this node's immediate children using CSS selector +selector+
def >(selector) # rubocop:disable Naming/BinaryOperatorParameterName
- ns = (document.root&.namespaces || {})
+ ns = document.root&.namespaces || {}
xpath(CSS.xpath_for(selector, prefix: "./", ns: ns).first)
end
@@ -229,7 +229,7 @@
def xpath_impl(node, path, handler, ns, binds)
ctx = XPathContext.new(node)
ctx.register_namespaces(ns)
- path = path.gsub(/xmlns:/, " :") unless Nokogiri.uses_libxml?
+ path = path.gsub("xmlns:", " :") unless Nokogiri.uses_libxml?
binds&.each do |key, value|
ctx.register_variable(key.to_s, value)
@@ -269,7 +269,7 @@
end
ns, binds = hashes.reverse
- ns ||= (document.root&.namespaces || {})
+ ns ||= document.root&.namespaces || {}
[params, handler, ns, binds]
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml/syntax_error.rb
new/lib/nokogiri/xml/syntax_error.rb
--- old/lib/nokogiri/xml/syntax_error.rb 2023-11-17 16:30:28.000000000
+0100
+++ new/lib/nokogiri/xml/syntax_error.rb 2024-06-13 15:30:08.000000000
+0200
@@ -63,7 +63,7 @@
end
def location_to_s
- return nil if nil_or_zero?(line) && nil_or_zero?(column)
+ return if nil_or_zero?(line) && nil_or_zero?(column)
"#{line}:#{column}"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xml.rb new/lib/nokogiri/xml.rb
--- old/lib/nokogiri/xml.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xml.rb 2024-06-13 15:30:08.000000000 +0200
@@ -11,7 +11,7 @@
module XML
# Original C14N 1.0 spec canonicalization
- XML_C14N_1_0 = 0
+ XML_C14N_1_0 = 0
# Exclusive C14N 1.0 spec canonicalization
XML_C14N_EXCLUSIVE_1_0 = 1
# C14N 1.1 spec canonicalization
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xslt/stylesheet.rb
new/lib/nokogiri/xslt/stylesheet.rb
--- old/lib/nokogiri/xslt/stylesheet.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xslt/stylesheet.rb 2024-06-13 15:30:08.000000000 +0200
@@ -10,15 +10,37 @@
# doc = Nokogiri::XML(File.read('some_file.xml'))
# xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
#
- # puts xslt.transform(doc)
+ # xslt.transform(doc) # => Nokogiri::XML::Document
#
- # See Nokogiri::XSLT::Stylesheet#transform for more transformation
- # information.
+ # Many XSLT transformations include serialization behavior to emit a
non-XML document. For these
+ # cases, please take care to invoke the #serialize method on the result of
the transformation:
+ #
+ # doc = Nokogiri::XML(File.read('some_file.xml'))
+ # xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
+ # xslt.serialize(xslt.transform(doc)) # => String
+ #
+ # or use the #apply_to method, which is a shortcut for
`serialize(transform(document))`:
+ #
+ # doc = Nokogiri::XML(File.read('some_file.xml'))
+ # xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
+ # xslt.apply_to(doc) # => String
+ #
+ # See Nokogiri::XSLT::Stylesheet#transform for more information and
examples.
class Stylesheet
- ###
- # Apply an XSLT stylesheet to an XML::Document.
- # +params+ is an array of strings used as XSLT parameters.
- # returns serialized document
+ # :call-seq:
+ # apply_to(document, params = []) -> String
+ #
+ # Apply an XSLT stylesheet to an XML::Document and serialize it
properly. This method is
+ # equivalent to calling #serialize on the result of #transform.
+ #
+ # [Parameters]
+ # - +document+ is an instance of XML::Document to transform
+ # - +params+ is an array of strings used as XSLT parameters, passed into
#transform
+ #
+ # [Returns]
+ # A string containing the serialized result of the transformation.
+ #
+ # See Nokogiri::XSLT::Stylesheet#transform for more information and
examples.
def apply_to(document, params = [])
serialize(transform(document, params))
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri/xslt.rb new/lib/nokogiri/xslt.rb
--- old/lib/nokogiri/xslt.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri/xslt.rb 2024-06-13 15:30:08.000000000 +0200
@@ -101,7 +101,7 @@
params.flatten.each_slice(2).with_object([]) do |kv, quoted_params|
key, value = kv.map(&:to_s)
value = if value.include?("'")
- "concat('#{value.gsub(/'/, %q{', "'", '})}')"
+ "concat('#{value.gsub("'", %q{', "'", '})}')"
else
"'#{value}'"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/nokogiri.rb new/lib/nokogiri.rb
--- old/lib/nokogiri.rb 2023-11-17 16:30:28.000000000 +0100
+++ new/lib/nokogiri.rb 2024-06-13 15:30:08.000000000 +0200
@@ -94,7 +94,7 @@
# :nodoc:
def install_default_aliases
- warn("Nokogiri.install_default_aliases is deprecated and will be removed
in a future version of Nokogiri. Please call
Nokogiri::EncodingHandler.install_default_aliases instead.")
+ warn("Nokogiri.install_default_aliases is deprecated. Please call
Nokogiri::EncodingHandler.install_default_aliases instead. This will become an
error in Nokogiri v1.17.0.", uplevel: 1, category: :deprecated) # deprecated in
v1.14.0, remove in v1.17.0
Nokogiri::EncodingHandler.install_default_aliases
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2023-11-17 16:30:28.000000000 +0100
+++ new/metadata 2024-06-13 15:30:08.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: nokogiri
version: !ruby/object:Gem::Version
- version: 1.15.5
+ version: 1.16.6
platform: ruby
authors:
- Mike Dalessio
@@ -17,10 +17,10 @@
- Sergio Arbeo
- Timothy Elliott
- Nobuyoshi Nakada
-autorequire:
+autorequire:
bindir: bin
cert_chain: []
-date: 2023-11-17 00:00:00.000000000 Z
+date: 2024-06-13 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: mini_portile2
@@ -272,7 +272,7 @@
- patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch
- patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch
- patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch
-- ports/archives/libxml2-2.11.6.tar.xz
+- ports/archives/libxml2-2.12.8.tar.xz
- ports/archives/libxslt-1.1.39.tar.xz
homepage: https://nokogiri.org
licenses:
@@ -284,7 +284,7 @@
changelog_uri: https://nokogiri.org/CHANGELOG.html
source_code_uri: https://github.com/sparklemotion/nokogiri
rubygems_mfa_required: 'true'
-post_install_message:
+post_install_message:
rdoc_options:
- "--main"
- README.md
@@ -294,15 +294,15 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 2.7.0
+ version: 3.0.0
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubygems_version: 3.4.19
-signing_key:
+rubygems_version: 3.5.11
+signing_key:
specification_version: 4
summary: Nokogiri (é¸) makes it easy and painless to work with XML and HTML
from Ruby.
test_files: []
Binary files old/ports/archives/libxml2-2.11.6.tar.xz and
new/ports/archives/libxml2-2.11.6.tar.xz differ
Binary files old/ports/archives/libxml2-2.12.8.tar.xz and
new/ports/archives/libxml2-2.12.8.tar.xz differ
++++++ only-complain-about-version-diff-if-it-is-older.patch ++++++
diff --git a/lib/nokogiri/version/info.rb b/lib/nokogiri/version/info.rb
index 95f29e56..427b79ad 100644
--- a/lib/nokogiri/version/info.rb
+++ b/lib/nokogiri/version/info.rb
@@ -2,6 +2,7 @@
require "singleton"
require "shellwords"
+require "rubygems"
module Nokogiri
class VersionInfo # :nodoc:
@@ -73,11 +74,11 @@ module Nokogiri
warnings = []
if libxml2?
- if compiled_libxml_version != loaded_libxml_version
+ if Gem::Version.new(compiled_libxml_version) >
Gem::Version.new(loaded_libxml_version)
warnings << "Nokogiri was built against libxml version
#{compiled_libxml_version}, but has dynamically loaded #{loaded_libxml_version}"
end
- if compiled_libxslt_version != loaded_libxslt_version
+ if Gem::Version.new(compiled_libxslt_version) >
Gem::Version.new(loaded_libxslt_version)
warnings << "Nokogiri was built against libxslt version
#{compiled_libxslt_version}, but has dynamically loaded
#{loaded_libxslt_version}"
end
end