nokolexbor 0.4.1-x64-mingw-ucrt → 0.5.0-x64-mingw-ucrt

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: 43200f39ffb7e90e0e125df20c6900c163d9bc83f877d2196d8a2b525e6da009
4
- data.tar.gz: aa39d63906d7f5f27f850d0f446f812424082c55bc56158501c199403a4f401a
3
+ metadata.gz: 2e0b926c2277f378df1206598feb5d3a05df6595ac92f2e592283fa4f5787c8e
4
+ data.tar.gz: e77a5c194bf50142a5fbc33a903139d7920ddef52c1a921eebb6e66bf337cc39
5
5
  SHA512:
6
- metadata.gz: 8080a178b6cf715812ffa36bb10e2629eef483a2f3d8f88c34e4120b242d0587c98b3088d16f771fc09b13efc53fec9c023b10b176d48304109f8c0b29e8094b
7
- data.tar.gz: 65fe631ce646294357b759df5aa50209765e5343b65ddc94f475ea63979b0d373cf7b5173f664b536d2a9376f695db610531f801ad637599a6e759af549c99a8
6
+ metadata.gz: 63ae4c9bd3855cc541e8a8cb381b24e1a6aa67409d9cbe3cb76cf543ccefca7d8dac7e47cab1ed16e7be9f5258aa49aaf505d856262e5ef3132630159c1ca25e
7
+ data.tar.gz: '096914d05f665bdeb80150f06f9b65c2114a60c02cb4c78de306d1da9ca730b7b520f823f78d21e785a277082066fe192b0a5e792d7de73b951a8de41ae9c8c1'
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.1'
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.1
4
+ version: 0.5.0
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Yicheng Zhou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-04 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