rexle 1.0.27 → 1.0.28

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
  SHA1:
3
- metadata.gz: ab26e53944edc50b881c1145d16427d4323e6f5d
4
- data.tar.gz: 18bd7854feecfa76f4c8c0369a99a47eb5d7532f
3
+ metadata.gz: 9a1d04a3bbbebe6ac28ecef677f260599677823e
4
+ data.tar.gz: 26c280d22625e757fddfa47a8f264790f5244458
5
5
  SHA512:
6
- metadata.gz: ffa75f7be8303dffcac407e07f6c53498fbccebab53823ebfde5154f1a894f0e52d606e6ff274b443ca2b7e775e6b55b25f14aebb1537effaf2fb00aa302324d
7
- data.tar.gz: 3ac62dceb04d8d3eaeeefcac503c25a07df7e69a437da44d40cca3229f55d5cf65cbde7cd5af4fbabc694bf1c7c7ed72705c4e0af92e5ec08a7107e4712a0ff4
6
+ metadata.gz: 0e15d380c21d430e9b0c9913f536a2a30a86c2fb2743cb52167a30e38e5967ab948015a804bbaf5f6cdf050727776cc5f6d67c9360e2d8f68e40c92eb369a80c
7
+ data.tar.gz: e4fe7b85fc12dc1cfea3eb9a702d6bd20a56431a2ded71a9f385a598f2c931d90dc081c646ab1fa639a0d632cf703ccbaa08c112c11eb0f1042ffb6d2120f635
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -14,6 +14,9 @@ include REXML
14
14
 
15
15
  # 19-Oct-2014: feature: An XPath containing the attribute @class is
16
16
  # now treated as a type of CSS selector storage area
17
+ # feature: Implemented Rexle::Element#previous_element and
18
+ # Rexle::Element#next_element
19
+
17
20
  # 13-Oct-2014: feature: Implemented Rexle#clone
18
21
  # 12-Oct-2014: feature: Implemented CSS style element selection
19
22
  # 27-Sep-2014: bug fix: ELement values are now explicitly transformed to string
@@ -316,6 +319,30 @@ class Rexle
316
319
  end
317
320
  end
318
321
 
322
+ def next_element()
323
+
324
+ id = self.object_id
325
+ a = self.parent.child_elements
326
+ i = a.index {|x| x.object_id == id} + 1
327
+
328
+ a[i] if i < a.length
329
+
330
+ end
331
+
332
+ alias next_sibling next_element
333
+
334
+ def previous_element()
335
+
336
+ id = self.object_id
337
+ a = self.parent.child_elements
338
+ i = a.index {|x| x.object_id == id} - 1
339
+
340
+ a[i] if i >= 0
341
+
342
+ end
343
+
344
+ alias previous_sibling previous_element
345
+
319
346
  def xpath(path, rlist=[], &blk)
320
347
 
321
348
  r = filter_xpath(path, rlist=[], &blk)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.27
4
+ version: 1.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file