nokolexbor 0.4.2-x86-mingw32 → 0.5.2-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: 50e0e6ea3aecb6b2bf89b5f87f29edb2577c4df7f7af67194f73c1492ef076b1
4
+ data.tar.gz: 100f9dcd5a982a6ed28ff28636b437777600ac44cb8e98024272b63748690f0d
5
5
  SHA512:
6
- metadata.gz: e90c83986f19a24acf578f38f9d79691e8e74d8a4f70414bdb4d6ff014c30db6528ea92f8292c6af4e4dbd9a4cf6c98b9f43bc9f310a8c07df5a3eb9c4e1e9e6
7
- data.tar.gz: 1cf76c97ce200cff3806148024417d994d5a2d95caaca8cff8b65a413e2548a5432b90d6126ebcfac33527130fc2dd63d725d52f357625f0637dd7cef0505436
6
+ metadata.gz: fc40c9785db95483444fee84d5eee939470ba3e78d21a964b364bc61aa8d3d2e9076f88a0e602f5e271de7a1f8f103df79edcf25f8e84bc753a4b0d514aa99a9
7
+ data.tar.gz: 6e1f80c47ba2cebcfc6b554f3ec4ea60f07a04b5fa25d9faae3783084ace16e0f20847ceb70b717da771a310d536a3bdb4da5e3c113b493be099060acf15e571
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.2'
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.2
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-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler