From ca1dca02b029a7d6b8c9a3a5cc21221346f792bc Mon Sep 17 00:00:00 2001 From: why Date: Tue, 25 May 2004 14:57:25 +0000 Subject: * ext/syck/syck.c (syck_new_parser): clear parser on init. thanks, ts. [ruby-core:02931] * ext/syck/token.c (sycklex_yaml_utf8): buffer underflow. thanks, ts. [ruby-core:02929] * lib/yaml/baseemitter.rb (indent_text): simpler flow block code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/yaml/rubytypes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/yaml/rubytypes.rb') diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index 239688a6b2..f73eaf2dcd 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -392,7 +392,9 @@ class Range end def to_yaml( opts = {} ) YAML::quick_emit( self.object_id, opts ) { |out| - if self.begin.is_complex_yaml? or self.end.is_complex_yaml? or not to_yaml_properties.empty? + if self.begin.is_complex_yaml? or self.begin.respond_to? :to_str or + self.end.is_complex_yaml? or self.end.respond_to? :to_str or + not to_yaml_properties.empty? out.map( to_yaml_type ) { |map| map.add( 'begin', self.begin ) map.add( 'end', self.end ) -- cgit v1.2.3