aboutsummaryrefslogtreecommitdiffstats
path: root/lib/yaml/emitter.rb
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-10 14:15:27 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-10 14:15:27 +0000
commite921ea2d78f693c57fcb289faff3fc126dc8617a (patch)
tree6931c25c8907d5e481be1281be1a30297a3fff53 /lib/yaml/emitter.rb
parent3079dcab4ad9e7624703d772f6fc54dc10e45bce (diff)
downloadruby-e921ea2d78f693c57fcb289faff3fc126dc8617a.tar.gz
* ext/syck/token.c: preserve newlines prepended to a block.
* ext/syck/implicit.c (syck_match_implicit): added !merge and !default. * lib/yaml/constants.rb: remove '\z' escape. * lib/yaml/emitter.rb: ensure reset of @seq_map shortcut flag. * lib/yaml/encoding.rb: remove Unicode translation methods. * lib/yaml/rubytypes.rb: improved round-tripping of Strings. [ruby-core:1134] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/emitter.rb')
-rw-r--r--lib/yaml/emitter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/yaml/emitter.rb b/lib/yaml/emitter.rb
index 4b8541c2c3..66c7a6e813 100644
--- a/lib/yaml/emitter.rb
+++ b/lib/yaml/emitter.rb
@@ -60,6 +60,7 @@ module YAML
# Emit plain, normal flowing text
#
def node_text( value, block = '>' )
+ @seq_map = false
valx = value.dup
if @options[:UseBlock]
block = '|'
@@ -89,6 +90,7 @@ module YAML
# Emit a simple, unqouted string
#
def simple( value )
+ @seq_map = false
self << value.to_s
end
@@ -168,6 +170,7 @@ module YAML
#
if val.length.zero?
self << "{}"
+ @seq_map = false
else
if @buffer.length == 1 and @options[:UseHeader] == false and type.length.zero?
@headless = 1
@@ -213,6 +216,7 @@ module YAML
# Quick sequence
#
def seq( type, &e )
+ @seq_map = false
val = Sequence.new
e.call( val )
self << "#{type} " if type.length.nonzero?
@@ -282,7 +286,7 @@ module YAML
@buffer.push( "" )
#p [ self.id, @level, :END ]
if @level < 0
- YAML.internal_to_utf( header + @buffer.to_s[@headless..-1], @options[:Encoding] )
+ header + @buffer.to_s[@headless..-1]
end
end
end