diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-22 06:14:17 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-22 06:14:17 +0000 |
commit | 9780fc27d941d6975fb29e96584add5383f0316c (patch) | |
tree | 61a47dc64a0d9f0b8af06a0ec2ec27084360790a /lib/yaml/rubytypes.rb | |
parent | 5e1c96af5323f757c9875ea1fb5b754e4dd257cd (diff) | |
download | ruby-9780fc27d941d6975fb29e96584add5383f0316c.tar.gz |
* ext/syck/rubyext.c (rb_syck_err_handler): raise ArgumentError on
malformed YAML.
* lib/yaml/rubytypes.rb: String#to_yaml was missing space indicators at
the end of a line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/rubytypes.rb')
-rw-r--r-- | lib/yaml/rubytypes.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index ae5585db5d..a670237635 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -1,4 +1,5 @@ require 'date' +require 'yaml/constants' # # Type conversions # @@ -273,7 +274,7 @@ class String "''" elsif YAML.detect_implicit( self ) != 'str' "\"#{YAML.escape( self )}\"" - elsif self =~ /#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}] |\n|\'/ + elsif self =~ /#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |\n|$)|\'/ "\"#{YAML.escape( self )}\"" elsif self =~ /^[^#{YAML::WORD_CHAR}]/ "\"#{YAML.escape( self )}\"" |