oga 3.1-java → 3.4-java

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: 7a1799ee6bf1998e7fd0c8bfef11d72f717bf6b1830d46a76dfd8cfeb1df84c2
4
- data.tar.gz: 0a709cba4d84d2b18a40d3037072ac7ca26a88135a4c6b2d988dcab182f87754
3
+ metadata.gz: e4f9c47be98cdb2d8108f3abb9c60383a21f3fd88d22ea24090149c966b61abe
4
+ data.tar.gz: 5fa65f1eb644d7d58d2ffec90e03523802ad20e285c3a4729d33640c1009c1a0
5
5
  SHA512:
6
- metadata.gz: 54cbf8ab056dfae4f6089d3a091ab5dedb2bf25bfa0ad60c86480eaa0f81ebece5a1a03cdffbadf8d6d1e65495d9f595d6e6c78c9153eeb24650e72dff152cb4
7
- data.tar.gz: 7454040bd3f8316b3e2cec43a60efc1be271f00e80696428a3831802d8711afadc73a20d1164a34b9c72924329586eeeec8106d90a44307d8c371706f166ce7b
6
+ metadata.gz: f1e020b32addfdd6cc375ea9746f4a4af33c870af28aa46ed0d5189a46a9b6cae03c3379c6681b28f9d146558cda77c79a74939f5615124b7c32c51ed9116dc6
7
+ data.tar.gz: 12a4f2dc9e4c43c23cc45fbfdee49f75f1bfba400b007fbe6f17a6edbafcb2cc4ca66e018f4634177b10b2f30cf44c9c9ca26589a395c989f39c991f0e81091e
data/lib/liboga.jar CHANGED
Binary file
data/lib/oga/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oga
2
- VERSION = '3.1'
2
+ VERSION = '3.4'
3
3
  end # Oga
@@ -46,6 +46,8 @@ module Oga
46
46
  # @param [Oga::XML::NodeSet|Array] nodes
47
47
  def children=(nodes)
48
48
  if nodes.is_a?(NodeSet)
49
+ nodes.owner = self
50
+ nodes.take_ownership_on_nodes
49
51
  @children = nodes
50
52
  else
51
53
  @children = NodeSet.new(nodes, self)
data/lib/oga/xml/node.rb CHANGED
@@ -49,6 +49,8 @@ module Oga
49
49
  # @param [Oga::XML::NodeSet|Array] nodes
50
50
  def children=(nodes)
51
51
  if nodes.is_a?(NodeSet)
52
+ nodes.owner = self
53
+ nodes.take_ownership_on_nodes
52
54
  @children = nodes
53
55
  else
54
56
  @children = NodeSet.new(nodes, self)
@@ -42,11 +42,7 @@ module Oga
42
42
  @owner = owner
43
43
  @existing = {}
44
44
 
45
- @nodes.each_with_index do |node, index|
46
- mark_existing(node)
47
-
48
- take_ownership(node, index) if @owner
49
- end
45
+ take_ownership_on_nodes
50
46
  end
51
47
 
52
48
  # Yields the supplied block for every node.
@@ -289,6 +285,14 @@ module Oga
289
285
  "NodeSet(#{values})"
290
286
  end
291
287
 
288
+ def take_ownership_on_nodes
289
+ @nodes.each_with_index do |node, index|
290
+ mark_existing(node)
291
+
292
+ take_ownership(node, index) if @owner
293
+ end
294
+ end
295
+
292
296
  private
293
297
 
294
298
  # Takes ownership of the given node. This only occurs when the current
@@ -63,8 +63,8 @@ module Oga
63
63
  #
64
64
  # @see [#xpath]
65
65
  # @return [Oga::XML::Node|Oga::XML::Attribute]
66
- def at_xpath(*args)
67
- result = xpath(*args)
66
+ def at_xpath(*args, namespaces: nil)
67
+ result = xpath(*args, namespaces: namespaces)
68
68
 
69
69
  result.is_a?(XML::NodeSet) ? result.first : result
70
70
  end
@@ -7,6 +7,8 @@ module Oga
7
7
  def to_xml
8
8
  Generator.new(self).to_xml
9
9
  end
10
+
11
+ alias_method :to_s, :to_xml
10
12
  end
11
13
  end
12
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oga
3
3
  version: !ruby/object:Gem::Version
4
- version: '3.1'
4
+ version: '3.4'
5
5
  platform: java
6
6
  authors:
7
7
  - Yorick Peterse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-08 00:00:00.000000000 Z
11
+ date: 2022-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -17,8 +17,8 @@ dependencies:
17
17
  - !ruby/object:Gem::Version
18
18
  version: '0'
19
19
  name: ast
20
- type: :runtime
21
20
  prerelease: false
21
+ type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
@@ -31,8 +31,8 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.1'
33
33
  name: ruby-ll
34
- type: :runtime
35
34
  prerelease: false
35
+ type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
@@ -45,8 +45,8 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  name: rake
48
- type: :development
49
48
  prerelease: false
49
+ type: :development
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
@@ -59,8 +59,8 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.0'
61
61
  name: rspec
62
- type: :development
63
62
  prerelease: false
63
+ type: :development
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
@@ -73,8 +73,8 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  name: yard
76
- type: :development
77
76
  prerelease: false
77
+ type: :development
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
@@ -87,8 +87,8 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  name: simplecov
90
- type: :development
91
90
  prerelease: false
91
+ type: :development
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
@@ -101,8 +101,8 @@ dependencies:
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  name: kramdown
104
- type: :development
105
104
  prerelease: false
105
+ type: :development
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
@@ -115,8 +115,8 @@ dependencies:
115
115
  - !ruby/object:Gem::Version
116
116
  version: '2.0'
117
117
  name: benchmark-ips
118
- type: :development
119
118
  prerelease: false
119
+ type: :development
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
@@ -129,8 +129,8 @@ dependencies:
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  name: rake-compiler
132
- type: :development
133
132
  prerelease: false
133
+ type: :development
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
225
  - !ruby/object:Gem::Version
226
226
  version: '0'
227
227
  requirements: []
228
- rubygems_version: 3.0.6
228
+ rubygems_version: 3.2.29
229
229
  signing_key:
230
230
  specification_version: 4
231
231
  summary: Oga is an XML/HTML parser written in Ruby.