lib/maven/model/utils.rb in maven-tools-0.32.4 vs lib/maven/model/utils.rb in maven-tools-0.32.5
- old
+ new
@@ -99,11 +99,11 @@
buf << "#{indent} </#{var}>\n"
end
when Hash
if val.size > 0
buf << "#{indent} <#{var}>\n"
- val.keys.sort{ |n,m| n.to_s <=> m.to_s }.each do |k|
+ val.keys.each do |k|
v = val[k]
if v.is_a? Tag
v.to_xml(buf, indent + " ")
else
buf << "#{indent} <#{k}>#{v}</#{k}>\n"
@@ -345,12 +345,11 @@
map_to_xml(buf, indent, @props)
buf << "#{indent}</#{@name}>\n"
end
def map_to_xml(buf, indent, map)
- # sort the hash over the keys
- map.collect { |k,v| [k.to_s, v]}.sort.each do |k,v|
+ map.each do |k,v|
case v
when Hash
buf << "#{indent} <#{k}>\n"
map_to_xml(buf, indent + " ", v)
buf << "#{indent} </#{k}>\n"
@@ -372,10 +371,12 @@
case i
when Hash
buf << "#{indent} <#{singular}>\n"
map_to_xml(buf, indent + " ", i)
buf << "#{indent} </#{singular}>\n"
+ when /^<.*>$/ #allow any kind of xml as is
+ buf << "#{indent} #{i}\n"
else
buf << "#{indent} <#{singular}>#{i}</#{singular}>\n"
end
end
buf << "#{indent} </#{k}>\n"
@@ -387,6 +388,6 @@
end
end
end
end
end
-end
\ No newline at end of file
+end