nokolexbor 0.3.3-x86_64-darwin → 0.3.4-x86_64-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: cead1d5973dbabeb2bac9e3e413d21e7dbe4e36e42e58fdf22ad110e02f3decf
4
- data.tar.gz: 443c22b64508e785863c7e552ead72cc00f71369b216f6ea38d2e29d10bb4f8a
3
+ metadata.gz: 532646880a625b09aa4a19c0bf691f78ee63000517d5d817f8f94d93d469cad2
4
+ data.tar.gz: 499894ac7636f670a71039301a536a8a47f493ade548324c3370674506fb8208
5
5
  SHA512:
6
- metadata.gz: 82efd32a9058e2e3ee63e1215dddfa3bb24fbe11a81d50f795738d10406b0d09eed48d00e301aab44796124150e7cf3d6cfd11295d833f0edfda3b21a50a5bb5
7
- data.tar.gz: abce68297cb6cdfd144291d1ad40b8c1c5d16b512400890e5405eedf16976e3d8434a79838cab2690ebb54763f3770c996c1c4b5926b5196efb1ed25f3116524
6
+ metadata.gz: b2b434d910c42b0f10576e12c68367d3eede9331c85ea878aede28c9a6980e377ddd098106625a63896d9c3d37123adf5daf22cf5f4f967759b157ae1b27bc5d
7
+ data.tar.gz: ab7f7a87860daebc8e7866dbca710cd3728c24ba84a0d0647d80993c95d597cf40d77a7bd01e3f50b853135affa7a487ab5e8a5a39831d91f1f94484530a50b0
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-darwin
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.bundle
51
51
  - lib/nokolexbor/3.0/nokolexbor.bundle
52
52
  - lib/nokolexbor/3.1/nokolexbor.bundle
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