lib/xml-write-stream/base.rb in xml-write-stream-1.0.2 vs lib/xml-write-stream/base.rb in xml-write-stream-1.1.0
- old
+ new
@@ -30,17 +30,14 @@
encoding: 'utf-8'
}
def write_text(text, options = {})
escape = options.fetch(:escape, true)
- stream.write(indent_spaces)
stream.write(
escape ? escape_text(text) : text
)
-
- write_newline
end
def write_header(attributes = {})
stream.write('<?xml ')
@@ -68,11 +65,10 @@
end
end
end
def write_open_tag(tag_name, attributes)
- stream.write(indent_spaces)
stream.write("<#{tag_name}")
if attributes.size > 0
stream.write(' ')
write_attributes(attributes)
@@ -80,10 +76,9 @@
stream.write('>')
end
def write_close_tag(tag_name)
- stream.write(indent_spaces)
stream.write("</#{tag_name}>")
end
def write_attributes(attributes)
attributes.each_pair.with_index do |(key, val), idx|