nokolexbor 0.5.4-x64-mingw-ucrt → 0.6.0-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bf3ede8234ea62bcb9678a3fa9eb8bc1427fafc57f00fa0d2c31ee21c711be5
4
- data.tar.gz: 6c8f8768b5c6a0d15864e165b4690a6e988e9d68888d1f539ef1c7e63b434365
3
+ metadata.gz: aa03165ae90c47e1683616086b27f041d69d84c0715ec77dfada7ceaea0edbc0
4
+ data.tar.gz: 421d975c1a726f79ae99c41e4ba9e52d046edd624cad170abe9de824fbe8c0a0
5
5
  SHA512:
6
- metadata.gz: b1fd9d46bb0e65615766e717fb3cec7a23e839d76b1eb9130191e2a737616849498515e94e5311e6c844b9009d7ae8345330d9f33ef9d4ac53718d7f5050b1a7
7
- data.tar.gz: f194c92fd2ff415e3c84b2ba89f64277e1c85a0da1659b4adc7d7e3e955e36ca991fd9d5795d3bd05e088377a844c0c0135f57a4b142e44ea7c3fdc03e9f3e0a
6
+ metadata.gz: 844b90e43e6e053945006218d1656c5a4dc4d0d634be35682a1dd4da0ce4f99a2b0a15e9393677fc5b9565d3459d12dddcd56dc486b32dfe766b1d161c2a4da6
7
+ data.tar.gz: a5927ed9d1527f279380baa59a76c9e9d247681eabb72fe642ce73bcf4ca0d257fef036821c5b2110406260604064043c92d6926493ab0ef216fa240fe4b5107
Binary file
Binary file
Binary file
Binary file
@@ -717,18 +717,38 @@ module Nokolexbor
717
717
 
718
718
  def xpath_query_from_css_rule(rule, ns)
719
719
  ensure_nokogiri
720
- if defined? Nokogiri::CSS::XPathVisitor::BuiltinsConfig
721
- visitor = Nokogiri::CSS::XPathVisitor.new(
722
- builtins: Nokogiri::CSS::XPathVisitor::BuiltinsConfig::OPTIMAL,
723
- doctype: :html4,
724
- )
720
+
721
+ unless defined?(Gem)
722
+ require 'rubygems'
723
+ end
724
+
725
+ v_1_17_0 = Gem::Version.new("1.17.0")
726
+ current_version = Gem::Version.new(Nokogiri::VERSION)
727
+
728
+ if current_version < v_1_17_0
729
+ if defined? Nokogiri::CSS::XPathVisitor::BuiltinsConfig
730
+ visitor = Nokogiri::CSS::XPathVisitor.new(
731
+ builtins: Nokogiri::CSS::XPathVisitor::BuiltinsConfig::OPTIMAL,
732
+ doctype: :html4,
733
+ )
734
+ else
735
+ visitor = Nokogiri::CSS::XPathVisitorOptimallyUseBuiltins.new
736
+ end
737
+ self.class::IMPLIED_XPATH_CONTEXTS.map do |implied_xpath_context|
738
+ Nokogiri::CSS.xpath_for(rule.to_s, { prefix: implied_xpath_context, ns: ns,
739
+ visitor: visitor, })
740
+ end.join(" | ")
725
741
  else
726
- visitor = Nokogiri::CSS::XPathVisitorOptimallyUseBuiltins.new
742
+ self.class::IMPLIED_XPATH_CONTEXTS.map do |implied_xpath_context|
743
+ visitor = Nokogiri::CSS::XPathVisitor.new(
744
+ builtins: Nokogiri::CSS::XPathVisitor::BuiltinsConfig::OPTIMAL,
745
+ doctype: :html4,
746
+ prefix: implied_xpath_context,
747
+ namespaces: ns,
748
+ )
749
+ Nokogiri::CSS.xpath_for(rule.to_s, visitor: visitor)
750
+ end.join(" | ")
727
751
  end
728
- self.class::IMPLIED_XPATH_CONTEXTS.map do |implied_xpath_context|
729
- Nokogiri::CSS.xpath_for(rule.to_s, { prefix: implied_xpath_context, ns: ns,
730
- visitor: visitor, })
731
- end.join(" | ")
732
752
  end
733
753
 
734
754
  def extract_params(params)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nokolexbor
4
- VERSION = '0.5.4'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokolexbor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.0
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Yicheng Zhou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-22 00:00:00.000000000 Z
11
+ date: 2024-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -49,6 +49,7 @@ files:
49
49
  - lib/nokolexbor/3.1/nokolexbor.so
50
50
  - lib/nokolexbor/3.2/nokolexbor.so
51
51
  - lib/nokolexbor/3.3/nokolexbor.so
52
+ - lib/nokolexbor/3.4/nokolexbor.so
52
53
  - lib/nokolexbor/document.rb
53
54
  - lib/nokolexbor/document_fragment.rb
54
55
  - lib/nokolexbor/node.rb
@@ -71,7 +72,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
72
  version: '3.1'
72
73
  - - "<"
73
74
  - !ruby/object:Gem::Version
74
- version: 3.4.dev
75
+ version: 3.5.dev
75
76
  required_rubygems_version: !ruby/object:Gem::Requirement
76
77
  requirements:
77
78
  - - ">="