rexle 1.0.27 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rexle.rb +27 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a1d04a3bbbebe6ac28ecef677f260599677823e
|
4
|
+
data.tar.gz: 26c280d22625e757fddfa47a8f264790f5244458
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e15d380c21d430e9b0c9913f536a2a30a86c2fb2743cb52167a30e38e5967ab948015a804bbaf5f6cdf050727776cc5f6d67c9360e2d8f68e40c92eb369a80c
|
7
|
+
data.tar.gz: e4fe7b85fc12dc1cfea3eb9a702d6bd20a56431a2ded71a9f385a598f2c931d90dc081c646ab1fa639a0d632cf703ccbaa08c112c11eb0f1042ffb6d2120f635
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexle.rb
CHANGED
@@ -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
metadata.gz.sig
CHANGED
Binary file
|