rexleparser 0.2.9 → 0.3.0
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.
- data/lib/rexleparser.rb +14 -2
- metadata +2 -2
data/lib/rexleparser.rb
CHANGED
@@ -47,6 +47,16 @@ class RexleParser
|
|
47
47
|
value << a.shift until a[0..2].join == ']]>' or a.length <= 1
|
48
48
|
a.slice!(0,3)
|
49
49
|
element = [name, value, {}]
|
50
|
+
elsif a[0..2].join == '!--' then
|
51
|
+
name = '!-'
|
52
|
+
#<![CDATA[
|
53
|
+
#<!--
|
54
|
+
3.times{ a.shift }
|
55
|
+
value = ''
|
56
|
+
|
57
|
+
value << a.shift until a[0..2].join == '-->' or a.length <= 1
|
58
|
+
a.slice!(0,3)
|
59
|
+
element = [name, value, {}]
|
50
60
|
else
|
51
61
|
|
52
62
|
name = ''
|
@@ -145,10 +155,12 @@ class RexleParser
|
|
145
155
|
end
|
146
156
|
|
147
157
|
def get_attributes(raw_attributes)
|
148
|
-
raw_attributes.scan(/([\w:]+\='[^']
|
158
|
+
r = raw_attributes.scan(/([\w:]+\='[^']*)'|([\w:]+\="[^"]*)"/).map(&:compact).flatten.inject({}) do |r, x|
|
149
159
|
|
150
160
|
attr_name, val = x.split(/=/)
|
151
|
-
r.merge(attr_name.to_sym => val[1..-
|
161
|
+
r.merge(attr_name.to_sym => val[1..-1])
|
152
162
|
end
|
163
|
+
|
164
|
+
return r
|
153
165
|
end
|
154
166
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rexleparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.3.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Robertson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-11-20 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|