1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
why 2003-05-22 06:14:17 +00:00
parent 5e1c96af53
commit 9780fc27d9
3 changed files with 11 additions and 2 deletions

View file

@ -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 )}\""