nokogiri 1.15.2 → 1.16.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +17 -14
- data/README.md +4 -1
- data/dependencies.yml +9 -8
- data/ext/nokogiri/extconf.rb +3 -4
- data/ext/nokogiri/html4_sax_push_parser.c +1 -1
- data/ext/nokogiri/nokogiri.h +10 -3
- data/ext/nokogiri/test_global_handlers.c +1 -1
- data/ext/nokogiri/xml_cdata.c +28 -23
- data/ext/nokogiri/xml_document.c +13 -5
- data/ext/nokogiri/xml_namespace.c +0 -4
- data/ext/nokogiri/xml_node.c +6 -9
- data/ext/nokogiri/xml_reader.c +26 -48
- data/ext/nokogiri/xml_relax_ng.c +1 -1
- data/ext/nokogiri/xml_sax_parser_context.c +4 -0
- data/ext/nokogiri/xml_sax_push_parser.c +1 -1
- data/ext/nokogiri/xml_schema.c +13 -8
- data/ext/nokogiri/xml_syntax_error.c +3 -3
- data/ext/nokogiri/xml_text.c +24 -19
- data/ext/nokogiri/xml_xpath_context.c +2 -5
- data/ext/nokogiri/xslt_stylesheet.c +8 -3
- data/gumbo-parser/Makefile +18 -0
- data/gumbo-parser/src/error.c +1 -1
- data/gumbo-parser/src/parser.c +8 -5
- data/gumbo-parser/src/tokenizer.c +1 -0
- data/lib/nokogiri/css/parser_extras.rb +1 -1
- data/lib/nokogiri/css/xpath_visitor.rb +1 -21
- data/lib/nokogiri/html4/document.rb +1 -1
- data/lib/nokogiri/html4/encoding_reader.rb +1 -1
- data/lib/nokogiri/html5.rb +0 -66
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/version/info.rb +6 -5
- data/lib/nokogiri/xml/attr.rb +2 -2
- data/lib/nokogiri/xml/document.rb +4 -5
- data/lib/nokogiri/xml/document_fragment.rb +2 -2
- data/lib/nokogiri/xml/namespace.rb +1 -2
- data/lib/nokogiri/xml/node.rb +31 -24
- data/lib/nokogiri/xml/node_set.rb +3 -3
- data/lib/nokogiri/xml/reader.rb +10 -9
- data/lib/nokogiri/xml/searchable.rb +3 -3
- data/lib/nokogiri/xml/syntax_error.rb +1 -1
- data/lib/nokogiri/xml.rb +1 -1
- data/lib/nokogiri/xslt/stylesheet.rb +29 -7
- data/lib/nokogiri/xslt.rb +1 -1
- data/lib/nokogiri.rb +1 -1
- data/ports/archives/libxml2-2.12.7.tar.xz +0 -0
- data/ports/archives/libxslt-1.1.39.tar.xz +0 -0
- metadata +9 -9
- data/ports/archives/libxml2-2.11.4.tar.xz +0 -0
- data/ports/archives/libxslt-1.1.38.tar.xz +0 -0
data/lib/nokogiri/xml.rb
CHANGED
@@ -10,15 +10,37 @@ module Nokogiri
|
|
10
10
|
# doc = Nokogiri::XML(File.read('some_file.xml'))
|
11
11
|
# xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
|
12
12
|
#
|
13
|
-
#
|
13
|
+
# xslt.transform(doc) # => Nokogiri::XML::Document
|
14
14
|
#
|
15
|
-
#
|
16
|
-
#
|
15
|
+
# Many XSLT transformations include serialization behavior to emit a non-XML document. For these
|
16
|
+
# cases, please take care to invoke the #serialize method on the result of the transformation:
|
17
|
+
#
|
18
|
+
# doc = Nokogiri::XML(File.read('some_file.xml'))
|
19
|
+
# xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
|
20
|
+
# xslt.serialize(xslt.transform(doc)) # => String
|
21
|
+
#
|
22
|
+
# or use the #apply_to method, which is a shortcut for `serialize(transform(document))`:
|
23
|
+
#
|
24
|
+
# doc = Nokogiri::XML(File.read('some_file.xml'))
|
25
|
+
# xslt = Nokogiri::XSLT(File.read('some_transformer.xslt'))
|
26
|
+
# xslt.apply_to(doc) # => String
|
27
|
+
#
|
28
|
+
# See Nokogiri::XSLT::Stylesheet#transform for more information and examples.
|
17
29
|
class Stylesheet
|
18
|
-
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
30
|
+
# :call-seq:
|
31
|
+
# apply_to(document, params = []) -> String
|
32
|
+
#
|
33
|
+
# Apply an XSLT stylesheet to an XML::Document and serialize it properly. This method is
|
34
|
+
# equivalent to calling #serialize on the result of #transform.
|
35
|
+
#
|
36
|
+
# [Parameters]
|
37
|
+
# - +document+ is an instance of XML::Document to transform
|
38
|
+
# - +params+ is an array of strings used as XSLT parameters, passed into #transform
|
39
|
+
#
|
40
|
+
# [Returns]
|
41
|
+
# A string containing the serialized result of the transformation.
|
42
|
+
#
|
43
|
+
# See Nokogiri::XSLT::Stylesheet#transform for more information and examples.
|
22
44
|
def apply_to(document, params = [])
|
23
45
|
serialize(transform(document, params))
|
24
46
|
end
|
data/lib/nokogiri/xslt.rb
CHANGED
@@ -101,7 +101,7 @@ module Nokogiri
|
|
101
101
|
params.flatten.each_slice(2).with_object([]) do |kv, quoted_params|
|
102
102
|
key, value = kv.map(&:to_s)
|
103
103
|
value = if value.include?("'")
|
104
|
-
"concat('#{value.gsub(
|
104
|
+
"concat('#{value.gsub("'", %q{', "'", '})}')"
|
105
105
|
else
|
106
106
|
"'#{value}'"
|
107
107
|
end
|
data/lib/nokogiri.rb
CHANGED
@@ -94,7 +94,7 @@ module Nokogiri
|
|
94
94
|
|
95
95
|
# :nodoc:
|
96
96
|
def install_default_aliases
|
97
|
-
warn("Nokogiri.install_default_aliases is deprecated
|
97
|
+
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
|
98
98
|
Nokogiri::EncodingHandler.install_default_aliases
|
99
99
|
end
|
100
100
|
end
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -17,10 +17,10 @@ authors:
|
|
17
17
|
- Sergio Arbeo
|
18
18
|
- Timothy Elliott
|
19
19
|
- Nobuyoshi Nakada
|
20
|
-
autorequire:
|
20
|
+
autorequire:
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
|
-
date:
|
23
|
+
date: 2024-05-13 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mini_portile2
|
@@ -272,8 +272,8 @@ files:
|
|
272
272
|
- patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch
|
273
273
|
- patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch
|
274
274
|
- patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch
|
275
|
-
- ports/archives/libxml2-2.
|
276
|
-
- ports/archives/libxslt-1.1.
|
275
|
+
- ports/archives/libxml2-2.12.7.tar.xz
|
276
|
+
- ports/archives/libxslt-1.1.39.tar.xz
|
277
277
|
homepage: https://nokogiri.org
|
278
278
|
licenses:
|
279
279
|
- MIT
|
@@ -284,7 +284,7 @@ metadata:
|
|
284
284
|
changelog_uri: https://nokogiri.org/CHANGELOG.html
|
285
285
|
source_code_uri: https://github.com/sparklemotion/nokogiri
|
286
286
|
rubygems_mfa_required: 'true'
|
287
|
-
post_install_message:
|
287
|
+
post_install_message:
|
288
288
|
rdoc_options:
|
289
289
|
- "--main"
|
290
290
|
- README.md
|
@@ -294,15 +294,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
294
294
|
requirements:
|
295
295
|
- - ">="
|
296
296
|
- !ruby/object:Gem::Version
|
297
|
-
version:
|
297
|
+
version: 3.0.0
|
298
298
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
299
299
|
requirements:
|
300
300
|
- - ">="
|
301
301
|
- !ruby/object:Gem::Version
|
302
302
|
version: '0'
|
303
303
|
requirements: []
|
304
|
-
rubygems_version: 3.
|
305
|
-
signing_key:
|
304
|
+
rubygems_version: 3.5.10
|
305
|
+
signing_key:
|
306
306
|
specification_version: 4
|
307
307
|
summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
|
308
308
|
test_files: []
|
Binary file
|
Binary file
|