summaryrefslogtreecommitdiff
path: root/lib/yaml/rubytypes.rb
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-25 14:57:25 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-25 14:57:25 +0000
commitca1dca02b029a7d6b8c9a3a5cc21221346f792bc (patch)
treeddaf1ae454ef0577c631ed5fe8114d8d64587d51 /lib/yaml/rubytypes.rb
parent82572952ecf82aad6bc47a51e3d63d7b52858b2d (diff)
* 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
Diffstat (limited to 'lib/yaml/rubytypes.rb')
-rw-r--r--lib/yaml/rubytypes.rb4
1 files changed, 3 insertions, 1 deletions
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 )