nokolexbor 0.4.2-arm64-darwin → 0.5.2-arm64-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: 566cf8d548c00f8784da30863d398659e28d28d14e7a7c6c7f5d6d77e3fa03c3
4
- data.tar.gz: 3fc128aa7dad3b6d95885c8f14dcb79c2aba3b3fba0cd74930dfb8699a5072ca
3
+ metadata.gz: 9cc6979932bf8a352aa3fad6f8d149baf7349f4937349cae4d0c7dfe98523421
4
+ data.tar.gz: 62d715080d07d79ddd38040cb8b49bdd0545349f5a9f1d2f85a76a5783df01a7
5
5
  SHA512:
6
- metadata.gz: adb7beae1aff477d4d5c9752046e873b77f20d0de672ede19ca41ae407ec696afc90e12d0565dbafcaadc6d712b1e205c4d456f4a3bc7bbadffb4176d8f3c3de
7
- data.tar.gz: ef14c7470a10f7e62c53af46b50526c83f153860adf7c17bd08eeafa1e2b9ef5c9d38c8a385e772df4320c8e47cb2a667951745e680ab65a1bd81ee50ea681e3
6
+ metadata.gz: 2e332862e62b74ab3e2112f9ca844d5036cabdc61175c968d51d5b802e1cb4c2303a52cd1a175eeabd1c676a096bb78f11d21c0958e6d933370407c76bd49afc
7
+ data.tar.gz: 6d449e24e2ea17889502630f76f045e03931fd0c0e821868cc3307733df1281456e7a392566a133c263e2838bb37af51115995be6bf222cc053e28a01dca0950
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: arm64-darwin
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