diff options
| author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-06 06:39:45 +0000 |
|---|---|---|
| committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-06 06:39:45 +0000 |
| commit | 4aeb2bbc60d75d9490536fc080ddee50267a8c6d (patch) | |
| tree | 77ab105fb4d3d964ac9b3f06b971d0c2d1a6b76f /lib/yaml.rb | |
| parent | 22cd153014ce943970112c62649e2da3315db23f (diff) | |
| download | ruby-4aeb2bbc60d75d9490536fc080ddee50267a8c6d.tar.gz ruby-4aeb2bbc60d75d9490536fc080ddee50267a8c6d.tar.xz ruby-4aeb2bbc60d75d9490536fc080ddee50267a8c6d.zip | |
* lib/yaml/rubytypes.rb (to_yaml): added instance variable handling
for Ranges, Strings, Structs, Regexps.
* lib/yaml/rubytypes.rb (to_yaml_fold): new method for setting a
String's flow style.
* lib/yaml.rb (YAML::object_maker): now uses Object.allocate.
* ext/syck/gram.c: fixed transfer methods on structs, broke it
last commit.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml.rb')
| -rw-r--r-- | lib/yaml.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/yaml.rb b/lib/yaml.rb index 644538c57..baa599d3c 100644 --- a/lib/yaml.rb +++ b/lib/yaml.rb @@ -162,13 +162,13 @@ module YAML # def YAML.object_maker( obj_class, val, is_attr = false ) if Hash === val - name = obj_class.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( /^[^{]+\{/, '' ) - end - o = ::Marshal.load( ostr ) + # name = obj_class.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( /^[^{]+\{/, '' ) + # end + o = obj_class.allocate unless is_attr val.each_pair { |k,v| o.instance_variable_set("@#{k}", v) |
