nokolexbor 0.3.3-x86_64-linux → 0.3.4-x86_64-linux

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: c895511e9adc328d15ad25c7efc571e565a7bddf2580e970398c774c05e78503
4
- data.tar.gz: ef7446f5afa9b8a7cef77268e2a9e1f67c3aaed62b6a225732134debd71ad539
3
+ metadata.gz: c7c90ef08e3d054aadea04d860e90518965147658929230047b1d872ec6900e7
4
+ data.tar.gz: 53023bacf95c7f2201ca44f5d223e7705bc328a1b28f526319ddf4f5346c149b
5
5
  SHA512:
6
- metadata.gz: a7b7f27b07d05964adfac448fd31348693c03e2577e45cd8ba3ab4e2028755a732c71db30a5a0f56e935dc5fba5f11b1fb3f0a87762ab356004578c024d64478
7
- data.tar.gz: 3713237c751de5fd1a1a549b158657df56afe39dce62ecec34a0ebbef1422bccb8ef7a65a76e2401db14a42e0f74ab1ca40a88583033dbf595d00750d8eeabc5
6
+ metadata.gz: aac39a68e202dff8a04b6b8b934a588fc4316551023f1900a72d835ddde475443e7b23487dece7184f1e65b371f965574f4409124209ce0c7a9281dc724e15e1
7
+ data.tar.gz: 8c79cf32463356b25cadf828157255f1cdc2ac5f33e567962e47689a78a530f24d6939ad220ac7d9ebe198617228850cc54738419d70ad482ae36643db09aabe
Binary file
Binary file
Binary file
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: x86_64-linux
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
@@ -50,7 +50,6 @@ files:
50
50
  - lib/nokolexbor/2.7/nokolexbor.so
51
51
  - lib/nokolexbor/3.0/nokolexbor.so
52
52
  - lib/nokolexbor/3.1/nokolexbor.so
53
- - lib/nokolexbor/attribute.rb
54
53
  - lib/nokolexbor/document.rb
55
54
  - lib/nokolexbor/document_fragment.rb
56
55
  - 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