nokolexbor 0.4.2-x86-mingw32 → 0.5.0-x86-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: a27db4f9b8442f954f07d4958c9130ed640fc8c5a760a81fbc8b5e93986ea74d
4
- data.tar.gz: 01d865fcb8038e79692d9ff3d6c4f4889f0785bde7ae82d5abd41ea3b7a5be22
3
+ metadata.gz: 04370aa3758404a5638c2b3044a5c057974a405c4f139b5f972c5e54acfd0759
4
+ data.tar.gz: b48b131d616534c1d62d8bfe8dadff65554e6e97aba8a9615d87ef65ee0f66e2
5
5
  SHA512:
6
- metadata.gz: e90c83986f19a24acf578f38f9d79691e8e74d8a4f70414bdb4d6ff014c30db6528ea92f8292c6af4e4dbd9a4cf6c98b9f43bc9f310a8c07df5a3eb9c4e1e9e6
7
- data.tar.gz: 1cf76c97ce200cff3806148024417d994d5a2d95caaca8cff8b65a413e2548a5432b90d6126ebcfac33527130fc2dd63d725d52f357625f0637dd7cef0505436
6
+ metadata.gz: 02752e63b7f227fb11bfcf7bcbcaf1b72a2d19b5d518000af0cdb794f2b79119224b9ea82161a42ed68e6e62f7efcfea1e62caa947c41fe910676fac0d4a4e04
7
+ data.tar.gz: 06f74bf1bf7b8ec37ce582de9081823913a5430c998e94abb130e0c889b07b0e81497521bca1f7c7582d711c2bb0e25c34e2de4d82b808a847bc817e3742e94f
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -51,12 +51,20 @@ module Nokolexbor
51
51
  def element?
52
52
  type == ELEMENT_NODE
53
53
  end
54
+ alias_method :elem?, :element?
54
55
 
55
56
  # @return true if this is a {Document}
56
57
  def document?
57
58
  is_a?(Nokolexbor::Document)
58
59
  end
59
60
 
61
+ # Get the path to this node as a CSS expression
62
+ def css_path
63
+ path.split(%r{/}).filter_map do |part|
64
+ part.empty? ? nil : part.gsub(/\[(\d+)\]/, ':nth-of-type(\1)')
65
+ end.join(" > ")
66
+ end
67
+
60
68
  # Get a list of ancestor Node of this Node
61
69
  #
62
70
  # @param [String, nil] selector The selector to match ancestors
@@ -285,6 +293,11 @@ module Nokolexbor
285
293
  parent_node.add_child(self)
286
294
  end
287
295
 
296
+ # @return true if this Node's attributes include <value>
297
+ def value?(value)
298
+ values.include?(value)
299
+ end
300
+
288
301
  # Iterate over each attribute name and value pair of this Node.
289
302
  #
290
303
  # @yield [String,String] The name and value of the current attribute.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nokolexbor
4
- VERSION = '0.4.2'
4
+ VERSION = '0.5.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.4.2
4
+ version: 0.5.0
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Yicheng Zhou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-05 00:00:00.000000000 Z
11
+ date: 2023-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler