From d4e661b4ad7589eb0656e92bc4b702b499a65cd1 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 20 Dec 2003 02:40:15 +0000 Subject: * lib/yaml.rb (YAML::YAML): adjust Marshal version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/yaml.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/yaml.rb') diff --git a/lib/yaml.rb b/lib/yaml.rb index d33f2e202a..e89171f205 100644 --- a/lib/yaml.rb +++ b/lib/yaml.rb @@ -1,4 +1,4 @@ -# vim:sw=4:ts=4 +# -*- mode: ruby; ruby-indent-level: 4; tab-width: 4 -*- vim: sw=4 ts=4 # $Id$ # # YAML.rb @@ -152,15 +152,15 @@ module YAML def YAML.object_maker( obj_class, val, is_attr = false ) if Hash === val name = obj_class.name - ostr = sprintf( "\004\006o:%c%s\000", name.length + 5, name ) + ostr = sprintf( "%c%co:%c%s\000", Marshal::MAJOR_VERSION, Marshal::MINOR_VERSION, + name.length + 5, name ) if is_attr ostr[ -1, 1 ] = Marshal.dump( val ).sub( /^[^{]+\{/, '' ) - p ostr end o = ::Marshal.load( ostr ) unless is_attr val.each_pair { |k,v| - o.instance_eval "@#{k} = v" + o.instance_variable_set("@#{k}", v) } end o -- cgit v1.2.3