nokolexbor 0.5.4-x64-mingw32 → 0.6.0-x64-mingw32

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: 9a3d92fcdc9bff50ea9b9374bd19ea5dedf9f0d6e1a1e096e0a9e0f6b4c1fad2
4
- data.tar.gz: 98e087367a060caf398fa0fa48805f604992692f712ffc6571e25c749b326fca
3
+ metadata.gz: f13e9f8397f9f74786eb4f54f5fac959f9612222cdbabc20cc841a376b639896
4
+ data.tar.gz: 887b33d32a04162e664444be8e337b9c842937c930b5ce5ce648e51cd45d6c58
5
5
  SHA512:
6
- metadata.gz: abba617a81e82964f59625cf3f338bf0cdc486b274e83a8fbb55a61103cdc250ab7fc9e227a40af75fda0278971433b3984de1adc53b4a8804e8e1cc3d8d75c5
7
- data.tar.gz: 962d8f7a45adcfb3fa95054829e5a7b483c7069fde5e15a9a96423624f6ed5bb0e82cca8904b6974b7271dee30c38f0d2565e918756321960f28dcce8726ca79
6
+ metadata.gz: b558f51c10ac2bc831f84a34a37c841df748962aa5dad755f551ed1ed04f1ef7378c6ea432c5d88a3cd7dd66c3d5310c6ad4ece910e72d07321afa426793a4bf
7
+ data.tar.gz: 1b4c47484ac087bc5439cf1c8fa7bb5c93599a81cc37e8885f17f3a6e02b448918e7b4f54a2d90b5b78935b0d898ffcf9c7689e664c941ca1473c6bd5d6510b0
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-mingw32
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