rexle 0.8.0 → 0.8.1
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/rexle.rb +11 -7
- metadata +2 -2
data/lib/rexle.rb
CHANGED
@@ -433,13 +433,17 @@ class Rexle
|
|
433
433
|
def scan_print(nodes)
|
434
434
|
|
435
435
|
nodes.map do |x|
|
436
|
-
|
437
|
-
|
436
|
+
unless x.name == '![' then
|
437
|
+
a = x.attributes.to_a.map{|k,v| "%s='%s'" % [k,v]}
|
438
|
+
tag = x.name + (a.empty? ? '' : ' ' + a.join(' '))
|
438
439
|
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
440
|
+
out = ["<%s>" % tag]
|
441
|
+
out << x.value unless x.value.nil? || x.value.empty?
|
442
|
+
out << scan_print(x.children)
|
443
|
+
out << "</%s>" % x.name
|
444
|
+
else
|
445
|
+
"<![CDATA[%s]]>" % x.value
|
446
|
+
end
|
443
447
|
end
|
444
448
|
|
445
449
|
end
|
@@ -455,4 +459,4 @@ class Rexle
|
|
455
459
|
[node.name, node.text.to_s, attributes, *children]
|
456
460
|
end
|
457
461
|
|
458
|
-
end
|
462
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors: []
|
7
7
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2011-01-
|
12
|
+
date: 2011-01-11 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|