rexle 0.7.2 → 0.7.3
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 +4 -2
- metadata +12 -2
data/lib/rexle.rb
CHANGED
|
@@ -390,10 +390,12 @@ class Rexle
|
|
|
390
390
|
f.write "<?xml version='1.0' encoding='UTF-8'?>\n" + xml
|
|
391
391
|
end
|
|
392
392
|
|
|
393
|
-
def xml()
|
|
393
|
+
def xml(options={})
|
|
394
|
+
o = {:pretty => false}.merge(options)
|
|
394
395
|
body = scan_print(self.root.children).join
|
|
395
396
|
a = self.root.attributes.to_a.map{|k,v| "%s='%s'" % [k,v]}
|
|
396
|
-
"<%s%s>%s</%s>" % [self.root.name, a.empty? ? '' : ' ' + a.join(' '), body, self.root.name]
|
|
397
|
+
out = "<%s%s>%s</%s>" % [self.root.name, a.empty? ? '' : ' ' + a.join(' '), body, self.root.name]
|
|
398
|
+
o[:pretty] == false ? out : (write out)
|
|
397
399
|
end
|
|
398
400
|
|
|
399
401
|
private
|
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.7.
|
|
4
|
+
version: 0.7.3
|
|
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: 2010-12-
|
|
12
|
+
date: 2010-12-27 00:00:00 +00:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
@@ -42,6 +42,16 @@ dependencies:
|
|
|
42
42
|
- !ruby/object:Gem::Version
|
|
43
43
|
version: "0"
|
|
44
44
|
version:
|
|
45
|
+
- !ruby/object:Gem::Dependency
|
|
46
|
+
name: pretty-xml
|
|
47
|
+
type: :runtime
|
|
48
|
+
version_requirement:
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: "0"
|
|
54
|
+
version:
|
|
45
55
|
description:
|
|
46
56
|
email:
|
|
47
57
|
executables: []
|