nokolexbor 0.3.3-x64-mingw-ucrt → 0.3.4-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: b3a9ae41e4e72bc88b565954821978a8aceefd5cad7834addd14270aa97d974a
4
- data.tar.gz: 965ae4b6706d44027dc96453bdcf75a8990257a6e00ec43cfc813a2aa622ee21
3
+ metadata.gz: d629b698ad3a54050d1c99194a62a7518b5d9c2744b7c21ea3bc0876f991354a
4
+ data.tar.gz: 60def520086d1bd13c2e48795e10db5d20fc0c63b697017410785ff89dd43db0
5
5
  SHA512:
6
- metadata.gz: 3c3a908f950c137e317a3030a9e2b0b63d7fd94b688e50a3deac249baff9f3c95aadcb735ec401e59bb28fa563320c7157574852724641ab6fbbf8c846b0846d
7
- data.tar.gz: 59f4f3b30a2e77d04d4a716f765da0c243fdca766409076fe373a219450240e18e002e8240dc63bc1bb2fe95262ae24f96b958d3f16f5c9813c3c6679f57b330
6
+ metadata.gz: 59ce97198f3c81ec2c6130e8c464cc37dae5ff3ece464491a666c116387571d3b9fffa258cdbd938fbf7fa85f1c7f3c2d5551228baf5d889fee509f0d5cb609b
7
+ data.tar.gz: f3196ca6a82842a4249a1f41532b491e83166ead01504f47399b1c087e00726b2cecf7c9d1de3d273868e67e28fdd42447f193de63faabb28c1a9fdebdb72b6b
Binary file
@@ -145,13 +145,10 @@ module Nokolexbor
145
145
  ancestors.last.css(selector).any? { |node| node == self }
146
146
  end
147
147
 
148
- def attribute(name)
149
- return nil unless key?(name)
150
- Attribute.new(name, attr(name))
151
- end
152
-
153
148
  def attributes
154
- attrs.map { |k, v| [k, Attribute.new(k, v)] }.to_h
149
+ attribute_nodes.each_with_object({}) do |node, hash|
150
+ hash[node.name] = node
151
+ end
155
152
  end
156
153
 
157
154
  def replace(node)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nokolexbor
4
- VERSION = '0.3.3'
4
+ VERSION = '0.3.4'
5
5
  end
data/lib/nokolexbor.rb CHANGED
@@ -26,7 +26,6 @@ require 'nokolexbor/node'
26
26
  require 'nokolexbor/document'
27
27
  require 'nokolexbor/node_set'
28
28
  require 'nokolexbor/document_fragment'
29
- require 'nokolexbor/attribute'
30
29
  require 'nokolexbor/xpath'
31
30
  require 'nokolexbor/xpath_context'
32
31
 
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.3.3
4
+ version: 0.3.4
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-01-09 00:00:00.000000000 Z
11
+ date: 2023-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -47,7 +47,6 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - lib/nokolexbor.rb
49
49
  - lib/nokolexbor/3.1/nokolexbor.so
50
- - lib/nokolexbor/attribute.rb
51
50
  - lib/nokolexbor/document.rb
52
51
  - lib/nokolexbor/document_fragment.rb
53
52
  - lib/nokolexbor/node.rb
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Nokolexbor
4
- class Attribute
5
- attr_accessor :name
6
- attr_accessor :value
7
-
8
- def initialize(name, value)
9
- @name = name
10
- @value = value
11
- end
12
-
13
- alias_method :text, :value
14
- alias_method :content, :value
15
- alias_method :to_s, :value
16
- alias_method :to_str, :value
17
- end
18
- end