nokolexbor 0.4.2-x64-mingw32 → 0.5.2-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: 862a50582cbce3bc8d6ae3386aa7ac99a740d5e60648045d127a62153004405f
4
- data.tar.gz: 8c93a0fb6d55186ccc658391c77984dcd79d976c890e541c562e0e5daf0bb5b0
3
+ metadata.gz: d56fd75317290fee1b374dfcbd0705833a19527c266a9109d5e41aa80a3cafe4
4
+ data.tar.gz: dd1f20797fa02a0b2a57340d925e4e978daccf3392b4fc69b6ca138154cba261
5
5
  SHA512:
6
- metadata.gz: aea6e939bc77cd917c28a8c9b1dbc37ca6cd3ca1593cb580dc8520a0afc55401ad70a1aae9329f1733b8a4f5df114655523a8504e2842f817b61e1b62c2c3b59
7
- data.tar.gz: fc5b1a7d734e97818a769ceec933730b8f9eb2fd8444f9b3b85dafb90646c9c20cf9919888aa0e8b9f04eef859c95742a6fb9c092cf830601dcd39767001c3b6
6
+ metadata.gz: bccbda2a553f4ff229c007b35a9dd0bf8fe3aa7fb34bf5b0b928ea7d13de264374b804dd4e19bb1eb53ff3dfbcede4c3dba51612045753b64a3e125af0db6576
7
+ data.tar.gz: 51dd5cef735347e43777456608f803a72a6fc3b1776c33d3b3ba3544a47ff00bbb8146f78cadb0d0b448ed6ae7f5bba9390f08a883bfbc40aa1b4141a1154572
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: x64-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