rexle 1.0.26 → 1.0.27
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 +10 -3
- metadata +2 -2
- 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: ab26e53944edc50b881c1145d16427d4323e6f5d
|
|
4
|
+
data.tar.gz: 18bd7854feecfa76f4c8c0369a99a47eb5d7532f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffa75f7be8303dffcac407e07f6c53498fbccebab53823ebfde5154f1a894f0e52d606e6ff274b443ca2b7e775e6b55b25f14aebb1537effaf2fb00aa302324d
|
|
7
|
+
data.tar.gz: 3ac62dceb04d8d3eaeeefcac503c25a07df7e69a437da44d40cca3229f55d5cf65cbde7cd5af4fbabc694bf1c7c7ed72705c4e0af92e5ec08a7107e4712a0ff4
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/rexle.rb
CHANGED
|
@@ -12,6 +12,8 @@ include REXML
|
|
|
12
12
|
|
|
13
13
|
# modifications:
|
|
14
14
|
|
|
15
|
+
# 19-Oct-2014: feature: An XPath containing the attribute @class is
|
|
16
|
+
# now treated as a type of CSS selector storage area
|
|
15
17
|
# 13-Oct-2014: feature: Implemented Rexle#clone
|
|
16
18
|
# 12-Oct-2014: feature: Implemented CSS style element selection
|
|
17
19
|
# 27-Sep-2014: bug fix: ELement values are now explicitly transformed to string
|
|
@@ -752,14 +754,19 @@ class Rexle
|
|
|
752
754
|
indices = [0] + andor_items + [raw_items.length]
|
|
753
755
|
|
|
754
756
|
if raw_items[0][0] == '@' then
|
|
757
|
+
|
|
755
758
|
raw_items.each{|x| x.gsub!(/^@/,'')}
|
|
756
759
|
cons_items = indices.each_cons(2).map{|x,y| raw_items.slice(x...y)}
|
|
757
760
|
|
|
758
761
|
items = cons_items.map do |x|
|
|
759
762
|
|
|
760
763
|
if x.length >= 3 then
|
|
761
|
-
|
|
762
|
-
|
|
764
|
+
if x[0] != 'class' then
|
|
765
|
+
x[1] = '==' if x[1] == '='
|
|
766
|
+
"h[:'%s'] %s %s" % x
|
|
767
|
+
else
|
|
768
|
+
"h[:class].include? %s" % x.last
|
|
769
|
+
end
|
|
763
770
|
else
|
|
764
771
|
|
|
765
772
|
x.join[/^(and|or)$/] ? x : ("h[:'%s']" % x)
|
|
@@ -859,7 +866,7 @@ class Rexle
|
|
|
859
866
|
block_given? ? blk.call(e) : e if i == attr_search
|
|
860
867
|
elsif attr_search[/i\s[<>\=]\s\d+/] and eval(attr_search) then
|
|
861
868
|
block_given? ? blk.call(e) : e
|
|
862
|
-
elsif h and attr_search[/^h\[/] and eval(attr_search)
|
|
869
|
+
elsif h and !h.empty? and attr_search[/^h\[/] and eval(attr_search) then
|
|
863
870
|
block_given? ? blk.call(e) : e
|
|
864
871
|
elsif attr_search[/^\(name ==/] and e.child_lookup.select{|name, attributes, value| eval(attr_search) }.length > 0
|
|
865
872
|
block_given? ? blk.call(e) : e
|
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.
|
|
4
|
+
version: 1.0.27
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
UOGKUMV5RApHDnC0ywMYNe0HK7qMSTP5YLKs8JUjNxpc5jl8+o3D3sHkNN4DzbQm
|
|
32
32
|
jVfzDZ+niKvAUA==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2014-10-
|
|
34
|
+
date: 2014-10-19 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: rexleparser
|
metadata.gz.sig
CHANGED
|
Binary file
|