rexleparser 0.5.2 → 0.5.3
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/lib/rexleparser.rb +21 -14
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 150be4b182e230e32a34e4de0d0b66476786c5b4
|
4
|
+
data.tar.gz: 7b28f8bb1181a3d3938c938d4f06368aaf5409d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d3e71bcab648bca2e19d6058897cecd2046c6cce45e3c7d6ee0017817a2585b3fa5cecda50cffd1c892a5ff69f865d2f5a422cf51722f88967b9894f85942fc
|
7
|
+
data.tar.gz: 7edbfbd4936878a5b8b462a6daa421eaea7ce96e127d4b5e427c383776cf7930382a3ffe7131a30ecc7691323acdcd222763de1f98acebbe8b427deff222c36b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rexleparser.rb
CHANGED
@@ -14,8 +14,7 @@ class RexleParser
|
|
14
14
|
@instructions = s.scan(/<\?([\w-]+) ([^>]+)\?>/)
|
15
15
|
@doctype = s.slice!(/<!DOCTYPE html>\n?/)
|
16
16
|
|
17
|
-
|
18
|
-
@to_a = reverse(parse_node(s2.strip.gsub(/<\?[^>]+>/,'').reverse))
|
17
|
+
@to_a = reverse(parse_node(s.strip.gsub(/<\?[^>]+>/,'').reverse))
|
19
18
|
|
20
19
|
end
|
21
20
|
|
@@ -27,7 +26,7 @@ class RexleParser
|
|
27
26
|
|
28
27
|
j = tagname
|
29
28
|
|
30
|
-
if
|
29
|
+
if r[0][/^>/] then
|
31
30
|
|
32
31
|
# end tag match
|
33
32
|
tag = r[/^>[^<]+</]
|
@@ -49,7 +48,7 @@ class RexleParser
|
|
49
48
|
broken_tag = tag
|
50
49
|
return [:child, [nil, [], broken_tag]] if broken_tag
|
51
50
|
|
52
|
-
elsif tag[
|
51
|
+
elsif tag[/^(?:>--|>\]\]).*(?:--!|\[ATADC\[!<)/] then
|
53
52
|
|
54
53
|
# it's a comment tag
|
55
54
|
return [:child, create_comment(tag)]
|
@@ -60,10 +59,11 @@ class RexleParser
|
|
60
59
|
return [:child, text]
|
61
60
|
end
|
62
61
|
|
63
|
-
elsif tag[
|
62
|
+
elsif tag[/^(?:>--|>\]\]).*(?:--!|\[ATADC\[!<)/m] then
|
64
63
|
|
65
|
-
i = r =~
|
66
|
-
|
64
|
+
i = r =~ /(\-\-!<|\[ATADC\[!<)/
|
65
|
+
len = ($1).length
|
66
|
+
tag = r.slice!(0,i+len)
|
67
67
|
|
68
68
|
# it's a comment tag
|
69
69
|
return [:child, create_comment(tag)]
|
@@ -83,21 +83,28 @@ class RexleParser
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def create_comment(tag)
|
86
|
-
|
87
|
-
|
86
|
+
|
87
|
+
tagname = tag[0,3] == '>--' ? '-!' : '[!'
|
88
|
+
rt = [">#{tagname}<",
|
89
|
+
[tag[/(?:>--|>\]\])(.*)(?:--!|\[ATADC\[!<)/m,1]], ">#{tagname}/<"
|
90
|
+
]
|
91
|
+
|
92
|
+
return rt
|
88
93
|
end
|
89
94
|
|
90
95
|
def parse_node(r, j=nil)
|
91
|
-
|
96
|
+
|
92
97
|
return unless r.length > 0
|
93
98
|
|
94
99
|
tag = r.slice!(/^>[^<]+</) if (r =~ /^>[^<]+</) == 0
|
95
100
|
|
96
|
-
if tag and tag[0,3]
|
101
|
+
if tag and tag[0,3][/>--|>\]\]/] then
|
97
102
|
|
98
|
-
i = r =~
|
99
|
-
|
100
|
-
|
103
|
+
i = r =~ /(\-\-!<|\[ATADC\[!<)/
|
104
|
+
len = ($1).length
|
105
|
+
tag += r.slice!(0,i+len)
|
106
|
+
|
107
|
+
#exit
|
101
108
|
# it's a comment tag
|
102
109
|
return create_comment tag
|
103
110
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
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.3
|
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-26 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email: james@r0bertson.co.uk
|
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
��ؠ������eE�R��&U�_����z�9}�z�k��?��v���u��ʎ��tuz��5㞞�BsP���13w��$d&:;����{ȱ��'��j9��HL����鸻��|fn'��'��.�����]ˤx���A�f�ۮ@�2�ma�����v�Z���v�m��L��TU�C����P���I%f-�p��H�����,�%�˳i\�9+'��]T>���h)�5���=�j�m/�\/
|