rexleparser 0.5.9 → 0.5.10
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/lib/rexleparser.rb +14 -5
- data.tar.gz.sig +4 -1
- 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: a8c6e0c98ab82d9ab25998d70a80ab85205e69fe
|
4
|
+
data.tar.gz: ca60e2d6f97490342287be767ca6507822880511
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eade36dcc002807e18bd07357b695f5b8bb8c95499a9f5ce91d58b34ff80793e0863a1fe4e4187baed922890f5526cc21221362ed5ea28c1d8b42de6628d8472
|
7
|
+
data.tar.gz: f62d6271b8d4c33cc0a65c090a66712ddcc03a32e34a8f77c28508399e5c24139a1a62ea737499152c82b6c25a64574cac93689d24b2736bafb4c1dba7795778
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rexleparser.rb
CHANGED
@@ -24,13 +24,16 @@ class RexleParser
|
|
24
24
|
|
25
25
|
def scan_next(r, tagname)
|
26
26
|
|
27
|
+
#puts '+scan_next : ' + r.inspect
|
28
|
+
|
27
29
|
j = tagname
|
28
30
|
|
29
31
|
if r[0] == '>' then
|
30
32
|
|
31
33
|
# end tag match
|
32
34
|
tag = r[/^>[^<]+</]
|
33
|
-
|
35
|
+
#puts 'tag: ' + tag.inspect
|
36
|
+
|
34
37
|
if tag[1][/[ \w"']/] and tag[-2] != '/' then
|
35
38
|
|
36
39
|
# is it the end tag to match the start tag?
|
@@ -57,7 +60,7 @@ class RexleParser
|
|
57
60
|
|
58
61
|
return [:child, text]
|
59
62
|
end
|
60
|
-
elsif tag[/>\/|\/<$/] then
|
63
|
+
elsif tag[/>\/|\/<$/] or tag[/^>.*[\w!]+\/<$/] then
|
61
64
|
return [:newnode]
|
62
65
|
elsif r[/^(?:>--|>\]\]).*(?:--!|\[ATADC\[!<)/m] then
|
63
66
|
|
@@ -69,8 +72,12 @@ class RexleParser
|
|
69
72
|
return [:child, create_comment(tag)]
|
70
73
|
else
|
71
74
|
|
72
|
-
|
73
|
-
|
75
|
+
r.sub!('>',';tg&')
|
76
|
+
|
77
|
+
i = r =~ />(?:[\-\/"'\w]|\]\])/ # collect until a tag is found or a CDATA element
|
78
|
+
text = r.slice!(0,i)
|
79
|
+
|
80
|
+
return [:child, text] if text
|
74
81
|
|
75
82
|
end # end of tag match
|
76
83
|
|
@@ -96,6 +103,7 @@ class RexleParser
|
|
96
103
|
|
97
104
|
def parse_node(r, j=nil)
|
98
105
|
|
106
|
+
#puts '+parse_node ' + r.inspect
|
99
107
|
return unless r.length > 0
|
100
108
|
|
101
109
|
tag = r.slice!(/^>[^<]+</) if (r =~ /^>[^<]+</) == 0
|
@@ -122,6 +130,7 @@ class RexleParser
|
|
122
130
|
until end_tag do
|
123
131
|
|
124
132
|
key, res = scan_next r, tagname
|
133
|
+
#puts "key: %s; res: %s" % [key, res]
|
125
134
|
|
126
135
|
case key
|
127
136
|
when :end_tag
|
@@ -163,7 +172,7 @@ class RexleParser
|
|
163
172
|
obj = raw_obj.clone
|
164
173
|
return obj.reverse! if obj.is_a? String
|
165
174
|
|
166
|
-
tag = obj.pop.reverse
|
175
|
+
tag = obj.pop.reverse
|
167
176
|
|
168
177
|
children = obj[-1]
|
169
178
|
|
data.tar.gz.sig
CHANGED
@@ -1 +1,4 @@
|
|
1
|
-
|
1
|
+
)X�fbVʰ����C�U��� �q���3�w�#�e�q>�H���1�����U�8�S��Z���+��n�9��^��L|�
|
2
|
+
a4��2ci����"o���dV��y��?U�*:j���{$�Dm
|
3
|
+
��5�����ٕ��/��Q����l�,\@��3:4E�5J��!��Q.`��ov`Y�q����
|
4
|
+
��6u�1� �p9o9e죭�<�����QA 4,�F�:�o���蠞����/��\Q
|
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.10
|
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-31 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email: james@r0bertson.co.uk
|
metadata.gz.sig
CHANGED
Binary file
|