nokolexbor 0.5.4-x86_64-darwin → 0.6.0-x86_64-darwin

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: d0cd7e4da8aec426e8eb8bc61e67e56864f1491efcc82d85ee63ea15fa29e6e9
4
- data.tar.gz: 010eb595764acb119d64fc4448f52bc64e18e7b1440a6c1eefdbc5109ff5bdee
3
+ metadata.gz: 4be4499af07229f8805855d4bc8e82671e38ac1aa96d8456782fdd2613730c03
4
+ data.tar.gz: 82cd3fc52e4d610c0704fc7ff054b583c583ccee9b7b9033ca3bdd0a8675025c
5
5
  SHA512:
6
- metadata.gz: eda6c3f9e6732de7ab911f17786e60c19d7e0a9ace9b72f26c8a2e85b2e41a0e4156141f81d87a905eac60a3d733d55487d1073cffdb7784f156dd0341d433b5
7
- data.tar.gz: 7fa4f7b6cf0848cd7cb6c55371a5b325d3062e590313acb93e6d645c193bd1429a0df598ce9c3bafa872bbba36a96aa399e37a5f0fea01049ac48f3f8543f2f0
6
+ metadata.gz: 7762fd206424af4de650191d3aa54244a44d718a5164c54decd6c0eece23a7b2feec63b5dcacf7dc039451bf4963d903d690cead2ce073991c07d1ffc2b1a773
7
+ data.tar.gz: 3e39ad961614d6444a521b89b5f7d7e521b2b9575fe45f99560f9c83368ba2bda23080364fe2cb87aae09ccb09f6f8a2260b180114103d6ae2540a01d9157ec1
Binary file
Binary file
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: x86_64-darwin
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
@@ -52,6 +52,7 @@ files:
52
52
  - lib/nokolexbor/3.1/nokolexbor.bundle
53
53
  - lib/nokolexbor/3.2/nokolexbor.bundle
54
54
  - lib/nokolexbor/3.3/nokolexbor.bundle
55
+ - lib/nokolexbor/3.4/nokolexbor.bundle
55
56
  - lib/nokolexbor/document.rb
56
57
  - lib/nokolexbor/document_fragment.rb
57
58
  - lib/nokolexbor/node.rb
@@ -74,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
75
  version: '2.6'
75
76
  - - "<"
76
77
  - !ruby/object:Gem::Version
77
- version: 3.4.dev
78
+ version: 3.5.dev
78
79
  required_rubygems_version: !ruby/object:Gem::Requirement
79
80
  requirements:
80
81
  - - ">="