oga 2.13 → 2.14

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: 8fdfbe43349e5415a6568cd45bf01a4a0c1229270a61c1a230e7bfb6db46f501
4
- data.tar.gz: 755af0586ff1080cf958231934bd05fc742249c1059e58a7a73203fe89b07e12
3
+ metadata.gz: '0184b6dd3129310044ca8c4bfa74f279566d8b50d93fe0bd313384fd635cc74c'
4
+ data.tar.gz: '088ee09d1c4b398bf80f478f5e3072fd7341de0a7ec50547827f1243bbc13391'
5
5
  SHA512:
6
- metadata.gz: 0f947b82c8f68bddb4e0c9e7fa40ec33d63ad5563d2e679713e4651881a7b89d55b83cd6fe5f0eb70143f10400ec18ba895d4a075b9f4af57ba4d2e6f099360d
7
- data.tar.gz: b749e164916d53b845ce506e3d950dc30fa0e99135882923175ceaea9fe3bb15d218d607d61a7613694c98cb65224a69444497852907b656e364c0f4c1bee84a
6
+ metadata.gz: 84f951cd7414fa3a312380e343dc997ae9f94bdec825cff45b5ad8574a84276281cd4de71fb434a3c5fef08f0d76991810fb142d75176f37f66da6ca5c4e3f32
7
+ data.tar.gz: 5fbd1267ed3bcac28fd9dcec7c2735bdfc9437b717cd45c640ca2285cf974ea4deb3c12c896605531d918860de5e73eb6fd819c4dd9e7fd316785c63d696a729
@@ -1,3 +1,3 @@
1
1
  module Oga
2
- VERSION = '2.13'
2
+ VERSION = '2.14'
3
3
  end # Oga
@@ -99,12 +99,14 @@ module Oga
99
99
  end
100
100
 
101
101
  # @see [Oga::XML::Node#each_ancestor]
102
- def each_ancestor(&block)
102
+ def each_ancestor
103
+ return to_enum(:each_ancestor) unless block_given?
104
+
103
105
  return unless element
104
106
 
105
107
  yield element
106
108
 
107
- element.each_ancestor(&block)
109
+ element.each_ancestor { |ancestor| yield ancestor }
108
110
  end
109
111
 
110
112
  private
@@ -180,6 +180,8 @@ module Oga
180
180
  #
181
181
  # @yieldparam [Oga::XML::Node]
182
182
  def each_ancestor
183
+ return to_enum(:each_ancestor) unless block_given?
184
+
183
185
  node = parent
184
186
 
185
187
  while node.is_a?(XML::Element)
@@ -53,6 +53,8 @@ module Oga
53
53
  #
54
54
  # @yieldparam [Oga::XML::Node]
55
55
  def each
56
+ return to_enum(:each) unless block_given?
57
+
56
58
  @nodes.each { |node| yield node }
57
59
  end
58
60
 
@@ -27,6 +27,8 @@ module Oga
27
27
  #
28
28
  # @yieldparam [Oga::XML::Node] The current node.
29
29
  def each_node
30
+ return to_enum(:each_node) unless block_given?
31
+
30
32
  visit = children.to_a.reverse
31
33
 
32
34
  until visit.empty?
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: '2.13'
4
+ version: '2.14'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yorick Peterse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-05 00:00:00.000000000 Z
11
+ date: 2018-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast