rexle 1.3.10 → 1.3.11
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 +18 -9
- metadata +2 -2
- metadata.gz.sig +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7d980bf644a58db05857db033db5e88ec71f6b2
|
4
|
+
data.tar.gz: de73c19a02ee7037c7ed4bb50a4fd4387ea6fa4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dec1b143e0de15b1dc3b2279180346a8f6caa07df8d388001d4f20efb011b2f045fa3421a51171128af997076ba52ecec4651a69e9fddf60cb11438186c74457
|
7
|
+
data.tar.gz: b922750f927f1e2da6181b0e0c558659a6d7ea69c6d08f9035c18cd9f1c475a52ff81565324ca9f865a897bb3e72088e11fa1d11a114e4581273703dda7da08c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexle.rb
CHANGED
@@ -12,6 +12,7 @@ require 'backtrack-xpath'
|
|
12
12
|
|
13
13
|
# modifications:
|
14
14
|
|
15
|
+
# 09-Mar-2016: bug fix: '.' now returns the current element
|
15
16
|
# 02-Mar-2016: improvement: When handling the HTML element iframe, it
|
16
17
|
# is no longer printed as a self-closing tag
|
17
18
|
# 05-Nov-2015: bug fix: UTF-8 encoding is now enforced when
|
@@ -426,6 +427,10 @@ class Rexle
|
|
426
427
|
length = query_xpath(path).flatten.compact.length
|
427
428
|
length
|
428
429
|
end
|
430
|
+
|
431
|
+
def current()
|
432
|
+
self
|
433
|
+
end
|
429
434
|
|
430
435
|
def at_css(selector)
|
431
436
|
self.root.element RexleCSS.new(selector).to_xpath
|
@@ -714,15 +719,26 @@ class Rexle
|
|
714
719
|
ename = element_name
|
715
720
|
end
|
716
721
|
|
717
|
-
if ename
|
722
|
+
if ename == '..' then
|
723
|
+
|
724
|
+
remaining_xpath = raw_path[/\.\.\/(.*)/,1]
|
725
|
+
# select the parent element
|
726
|
+
|
727
|
+
r2 = self.parent.xpath(remaining_xpath)
|
728
|
+
|
729
|
+
return r2
|
730
|
+
elsif ename == '.'
|
731
|
+
return self
|
732
|
+
else
|
718
733
|
|
719
734
|
return_elements = @child_elements.map.with_index.select do |x, i|
|
720
735
|
|
721
736
|
next unless x.is_a? Rexle::Element
|
722
737
|
|
723
|
-
|
738
|
+
x.name == ename or (ename == '*')
|
724
739
|
end
|
725
740
|
|
741
|
+
|
726
742
|
if selector then
|
727
743
|
ne = return_elements.inject([]) do |r,x|
|
728
744
|
i = x.last + selector
|
@@ -735,15 +751,8 @@ class Rexle
|
|
735
751
|
|
736
752
|
return_elements = ne.map {|x| [@child_elements[x], x] if x}
|
737
753
|
end
|
738
|
-
else
|
739
754
|
|
740
|
-
remaining_xpath = raw_path[/\.\.\/(.*)/,1]
|
741
|
-
# select the parent element
|
742
755
|
|
743
|
-
r2 = self.parent.xpath(remaining_xpath)
|
744
|
-
|
745
|
-
return r2
|
746
|
-
|
747
756
|
end
|
748
757
|
end
|
749
758
|
|
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.3.
|
4
|
+
version: 1.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
Tkua07gB3/nVO3aPg7C3vEbDZCxT3WAMli2uZisYT6ozmdAlDsixLjipgFN4If3z
|
32
32
|
Ej0QR3kvGcAvFQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-03-
|
34
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexleparser
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
B�{\�L#���J��,3{�Yˋ9�QG����.��x�M��H�� Yg��zD�vؓ�������ḓ��\E?���\�߂���A��%qPZ��6i8kMQ�킾.����G��?�A�{� �J�r�W�ߨ����e"�7�][h(N�������X4�!D�'Gh�
|
2
|
+
��!��:;㡲D���E�(
|
3
|
+
J|Z;�#z���ʍi�y�!�9C*i��H�Z"��Nj���-8�'Q��d�E
|
4
|
+
�����
|