nokogiri 1.18.0.rc1-x64-mingw-ucrt → 1.18.0-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -2
- data/ext/nokogiri/xml_xpath_context.c +1 -17
- data/lib/nokogiri/3.1/nokogiri.so +0 -0
- data/lib/nokogiri/3.2/nokogiri.so +0 -0
- data/lib/nokogiri/3.3/nokogiri.so +0 -0
- data/lib/nokogiri/3.4/nokogiri.so +0 -0
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/xml/searchable.rb +5 -28
- data/lib/nokogiri/xml/xpath_context.rb +0 -22
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 516b3ad2871a364c880639649eb8354c9f468c68008b82c0ae6fa89bfd64b4c2
|
4
|
+
data.tar.gz: ffd548cd90873515c461952e5cd1261de28b6ca580383de9f249e8ce130c22c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3522d26b60ec814bedc7244c7888ed028e035a128f5dfb54f94fd668b9ce874f97202b5192552d5e24cfb7ce2837e2934e80ac1c66ca6ef6170386164258501
|
7
|
+
data.tar.gz: ec28aebcd84b96ec610b89136e0b862ba0794d1e24fa2a6a23a5ea6976193f25b23e24b58a814eba5d17232f891ce79659c48211c7c47799b83b24b8d56cafa8
|
data/Gemfile
CHANGED
@@ -11,7 +11,7 @@ group :development do
|
|
11
11
|
|
12
12
|
# building extensions
|
13
13
|
gem "rake-compiler", "1.2.8"
|
14
|
-
gem "rake-compiler-dock", "1.7.0
|
14
|
+
gem "rake-compiler-dock", "1.7.0"
|
15
15
|
|
16
16
|
# parser generator
|
17
17
|
gem "rexical", "1.0.8"
|
@@ -34,5 +34,6 @@ end
|
|
34
34
|
# `bundle config set --local without rdoc`
|
35
35
|
# Then re-run `bundle install`.
|
36
36
|
group :rdoc do
|
37
|
-
gem "rdoc", "6.
|
37
|
+
gem "rdoc", "6.10.0"
|
38
|
+
gem "jar-dependencies", "0.4.1" if RUBY_PLATFORM == "java" # https://github.com/jruby/jruby/issues/7262
|
38
39
|
end
|
@@ -144,13 +144,6 @@ noko_xml_xpath_context_register_ns(VALUE rb_context, VALUE prefix, VALUE uri)
|
|
144
144
|
|
145
145
|
xmlXPathRegisterNs(c_context, (const xmlChar *)StringValueCStr(prefix), ns_uri);
|
146
146
|
|
147
|
-
VALUE registered_namespaces = rb_iv_get(rb_context, "@registered_namespaces");
|
148
|
-
if (NIL_P(uri)) {
|
149
|
-
rb_hash_delete(registered_namespaces, prefix);
|
150
|
-
} else {
|
151
|
-
rb_hash_aset(registered_namespaces, prefix, Qtrue);
|
152
|
-
}
|
153
|
-
|
154
147
|
return rb_context;
|
155
148
|
}
|
156
149
|
|
@@ -179,13 +172,6 @@ noko_xml_xpath_context_register_variable(VALUE rb_context, VALUE name, VALUE val
|
|
179
172
|
|
180
173
|
xmlXPathRegisterVariable(c_context, (const xmlChar *)StringValueCStr(name), xmlValue);
|
181
174
|
|
182
|
-
VALUE registered_variables = rb_iv_get(rb_context, "@registered_variables");
|
183
|
-
if (NIL_P(value)) {
|
184
|
-
rb_hash_delete(registered_variables, name);
|
185
|
-
} else {
|
186
|
-
rb_hash_aset(registered_variables, name, Qtrue);
|
187
|
-
}
|
188
|
-
|
189
175
|
return rb_context;
|
190
176
|
}
|
191
177
|
|
@@ -402,6 +388,7 @@ noko_xml_xpath_context_evaluate(int argc, VALUE *argv, VALUE rb_context)
|
|
402
388
|
);
|
403
389
|
}
|
404
390
|
|
391
|
+
/* TODO: use xmlXPathSetErrorHandler (as of 2.13.0) */
|
405
392
|
xmlSetStructuredErrorFunc((void *)rb_errors, noko__error_array_pusher);
|
406
393
|
xmlSetGenericErrorFunc((void *)rb_errors, _noko_xml_xpath_context__generic_exception_pusher);
|
407
394
|
|
@@ -460,9 +447,6 @@ noko_xml_xpath_context_new(VALUE klass, VALUE rb_node)
|
|
460
447
|
|
461
448
|
rb_context = TypedData_Wrap_Struct(klass, &_noko_xml_xpath_context_type, c_context);
|
462
449
|
|
463
|
-
rb_iv_set(rb_context, "@registered_namespaces", rb_hash_new());
|
464
|
-
rb_iv_set(rb_context, "@registered_variables", rb_hash_new());
|
465
|
-
|
466
450
|
return rb_context;
|
467
451
|
}
|
468
452
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -261,36 +261,13 @@ module Nokogiri
|
|
261
261
|
end
|
262
262
|
|
263
263
|
def xpath_impl(node, path, handler, ns, binds)
|
264
|
-
|
265
|
-
|
266
|
-
|
264
|
+
context = XPathContext.new(node)
|
265
|
+
context.register_namespaces(ns)
|
266
|
+
context.register_variables(binds)
|
267
267
|
|
268
|
-
|
268
|
+
path = path.gsub("xmlns:", " :") unless Nokogiri.uses_libxml?
|
269
269
|
|
270
|
-
|
271
|
-
end
|
272
|
-
end
|
273
|
-
|
274
|
-
if Nokogiri.uses_libxml? && ENV["NOKOGIRI_DEOPTIMIZE_XPATH"].nil? # env var is an escape hatch
|
275
|
-
# optimized path
|
276
|
-
def get_xpath_context(node)
|
277
|
-
context = Thread.current.thread_variable_get(:nokogiri_xpath_context)
|
278
|
-
if context
|
279
|
-
context.node = node
|
280
|
-
else
|
281
|
-
context = Thread.current.thread_variable_set(:nokogiri_xpath_context, XPathContext.new(node))
|
282
|
-
end
|
283
|
-
|
284
|
-
begin
|
285
|
-
yield context
|
286
|
-
ensure
|
287
|
-
context.reset
|
288
|
-
end
|
289
|
-
end
|
290
|
-
else
|
291
|
-
def get_xpath_context(node)
|
292
|
-
yield XPathContext.new(node)
|
293
|
-
end
|
270
|
+
context.evaluate(path, handler)
|
294
271
|
end
|
295
272
|
end
|
296
273
|
end
|
@@ -22,28 +22,6 @@ module Nokogiri
|
|
22
22
|
register_variable(key, value)
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
26
|
-
if Nokogiri.uses_libxml?
|
27
|
-
def reset
|
28
|
-
return unless
|
29
|
-
|
30
|
-
@registered_namespaces.each do |key, _|
|
31
|
-
register_ns(key, nil)
|
32
|
-
end
|
33
|
-
unless @registered_namespaces.empty?
|
34
|
-
warn "Nokogiri::XML::XPathContext#reset: unexpected registered namespaces: #{@registered_namespaces.keys}"
|
35
|
-
@registered_namespaces.clear
|
36
|
-
end
|
37
|
-
|
38
|
-
@registered_variables.each do |key, _|
|
39
|
-
register_variable(key, nil)
|
40
|
-
end
|
41
|
-
unless @registered_variables.empty?
|
42
|
-
warn "Nokogiri::XML::XPathContext#reset: unexpected registered variables: #{@registered_variables.keys}"
|
43
|
-
@registered_variables.clear
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
25
|
end
|
48
26
|
end
|
49
27
|
end
|
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.18.0
|
4
|
+
version: 1.18.0
|
5
5
|
platform: x64-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -20,7 +20,7 @@ authors:
|
|
20
20
|
autorequire:
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
|
-
date: 2024-12-
|
23
|
+
date: 2024-12-25 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: racc
|
@@ -310,9 +310,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
310
310
|
version: 3.5.dev
|
311
311
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
312
312
|
requirements:
|
313
|
-
- - "
|
313
|
+
- - ">="
|
314
314
|
- !ruby/object:Gem::Version
|
315
|
-
version:
|
315
|
+
version: '0'
|
316
316
|
requirements: []
|
317
317
|
rubygems_version: 3.3.26
|
318
318
|
signing_key:
|