rexleparser 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rexleparser.rb +11 -4
- metadata +2 -2
data/lib/rexleparser.rb
CHANGED
@@ -7,7 +7,7 @@ class RexleParser
|
|
7
7
|
|
8
8
|
def initialize(s)
|
9
9
|
super()
|
10
|
-
@a = scan_element(s.strip.gsub(/<\?[^>]+>/,'').split(//))
|
10
|
+
@a = scan_element(s.strip.gsub(/<\?[^>]+>/,'').split(//))
|
11
11
|
end
|
12
12
|
|
13
13
|
def to_a() @a end
|
@@ -71,11 +71,18 @@ class RexleParser
|
|
71
71
|
if a[i-1] == '/' then
|
72
72
|
|
73
73
|
raw_values << a.shift until (a[0] + a[1..-1].join.strip[0]) == '/>'
|
74
|
-
a.shift
|
74
|
+
a.shift(2)
|
75
|
+
|
76
|
+
after_text = []
|
77
|
+
after_text << a.shift until a[0] == '<' or a.length <= 1
|
78
|
+
#a.shift until a[0] == '<' or a.length < 1
|
75
79
|
raw_values.strip!
|
76
80
|
|
77
|
-
attributes = get_attributes(raw_values) if raw_values.length > 0
|
78
|
-
|
81
|
+
attributes = get_attributes(raw_values) if raw_values.length > 0
|
82
|
+
element = [name, '', attributes]
|
83
|
+
|
84
|
+
return [element] if after_text.empty?
|
85
|
+
return [element, after_text.join]
|
79
86
|
|
80
87
|
else
|
81
88
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rexleparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
5
|
+
version: 0.4.4
|
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: 2012-
|
13
|
+
date: 2012-08-12 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description:
|