rexleparser 0.5.6 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rexleparser.rb +17 -8
- metadata +2 -2
- metadata.gz.sig +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a5d991a280ef4abae08dec0939207a3f733a186
|
4
|
+
data.tar.gz: ed2b52b5072bb4ce90e7a53735c4b335296d4290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 103473a843dc1f21e19eb695b14cfbd1d55b4a3ad488436dcce351e373d51be8f129eb00bedbfc70d79342e8339ca349856814fea46c0e869d291163d0eee6ff
|
7
|
+
data.tar.gz: 423384afc80e9565070228760c3097a85caa75ee5cb2864d54830ecd36466090e6e644ff7a76dd45a83c4b8de40773108ad4f0e5a1c5802551778dcd55e74c64
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexleparser.rb
CHANGED
@@ -15,7 +15,7 @@ class RexleParser
|
|
15
15
|
@doctype = s.slice!(/<!DOCTYPE html>\n?/)
|
16
16
|
|
17
17
|
@to_a = reverse(parse_node(s.strip.gsub(/<\?[^>]+>/,'').reverse))
|
18
|
-
|
18
|
+
|
19
19
|
end
|
20
20
|
|
21
21
|
|
@@ -23,7 +23,7 @@ class RexleParser
|
|
23
23
|
|
24
24
|
|
25
25
|
def scan_next(r, tagname)
|
26
|
-
|
26
|
+
|
27
27
|
j = tagname
|
28
28
|
|
29
29
|
if r[0] == '>' then
|
@@ -31,7 +31,7 @@ class RexleParser
|
|
31
31
|
# end tag match
|
32
32
|
tag = r[/^>[^<]+</]
|
33
33
|
|
34
|
-
if tag[
|
34
|
+
if tag[1][/[ \w"']/] and tag[-2] != '/' then
|
35
35
|
|
36
36
|
# is it the end tag to match the start tag?
|
37
37
|
tag = r.slice!(/^>[^<]+</)
|
@@ -47,13 +47,18 @@ class RexleParser
|
|
47
47
|
broken_tag = tag
|
48
48
|
return [:child, [nil, [], broken_tag]] if broken_tag
|
49
49
|
else
|
50
|
+
|
51
|
+
text, newtag = tag.sub('>',';tg&').split(/>/,2)
|
52
|
+
|
53
|
+
if newtag then
|
54
|
+
tag = newtag
|
55
|
+
r.prepend '>' + tag
|
56
|
+
end
|
50
57
|
|
51
|
-
text, tag = tag.sub('>',';tg&').split(/>/,2)
|
52
|
-
r.prepend '>' + tag
|
53
58
|
return [:child, text]
|
54
59
|
end
|
55
|
-
elsif tag[
|
56
|
-
return [:
|
60
|
+
elsif tag[/>\/|\/<$/] then
|
61
|
+
return [:newnode]
|
57
62
|
elsif r[/^(?:>--|>\]\]).*(?:--!|\[ATADC\[!<)/m] then
|
58
63
|
|
59
64
|
i = r =~ /(\-\-!<|\[ATADC\[!<)/
|
@@ -72,7 +77,9 @@ class RexleParser
|
|
72
77
|
else
|
73
78
|
|
74
79
|
# it's a text value
|
75
|
-
|
80
|
+
i = r =~ />["'\w]/
|
81
|
+
text = r.slice!(0,i)
|
82
|
+
|
76
83
|
return [:child, text] if text
|
77
84
|
end
|
78
85
|
end
|
@@ -128,6 +135,8 @@ class RexleParser
|
|
128
135
|
children << res
|
129
136
|
when :newnode
|
130
137
|
children << parse_node(r, tagname)
|
138
|
+
else
|
139
|
+
break
|
131
140
|
end
|
132
141
|
end
|
133
142
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexleparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
CkjTMLaPwIQI6dsbG4bVJ7/XzL7c8niqJSF7M0yr1+2kUrWFUZMBMrUUxgZxSkjL
|
32
32
|
Cgd76bp2zjiyCw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-01-
|
34
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email: james@r0bertson.co.uk
|
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
��%��Q긞�V7N�����2�V�7#���e������'�ȓS�O�R���o]cW��߳tյ��/��-����:gXe `�m����|���S�a�&���1i��I��cRua�Ҷ�t�N��D-���N�$C�l�^�G��[Q��$&�!U�U�M3Ϊo�>ޱth�t�@=�7�%�jr���)q���h����������""qƎ+�`gLJN
|
2
|
+
~̦�����R����R�t��)�l�6�
|