From: Jano Svitok Date: 2007-08-29T00:39:11+09:00 Subject: Re: problem with yaml On 8/28/07, unbewusst wrote: > i'm using a yaml file to save my preferences in a RubyCocoa > application, however i get : > > /usr/lib/ruby/1.8/yaml.rb:347:in `allocate': allocator undefined for > Data (TypeError) > from /usr/lib/ruby/1.8/yaml.rb:347:in `object_maker' > from /usr/lib/ruby/1.8/yaml/rubytypes.rb:36 > from /usr/lib/ruby/1.8/yaml/rubytypes.rb:34:in `call' > from /Users/yt/work/RubyCocoa/eSync/build/Release/eSync.app/Contents/ > Resources/rb_main.rb:16:in `transfer' > from /usr/lib/ruby/1.8/yaml.rb:119:in `load' > from /usr/lib/ruby/1.8/yaml.rb:119:in `load' > from /Users/yt/work/RubyCocoa/eSync/build/Release/eSync.app/Contents/ > Resources/SyncDataSource.rb:55:in `initialize' > > > line 55 : > o=YAML::load(File.open("#{PREFS_FILE}")) > > > THE file : > > --- !ruby/object:Preferences > deepness: 2 > root: !ruby/object:Folder > "__slave_nsobj__": !ruby/object:Data {} > enabled: -1 > items: > - !ruby/object:Folder > "__slave_nsobj__": !ruby/object:Data {} > enabled: -1 > items: > - !ruby/object:Folder > "__slave_nsobj__": !ruby/object:Data {} > enabled: true > items: [] > name: Agenda > path: /Users/yt/Documents/OOo/Agenda > [...] > > > i even don't know where the lines ""__slave_nsobj__": !ruby/ > object:Data {}" are coming from... Just a blind guess: yaml doesn't know how to (de)serialize binary data for/from RubyCocoa extension. I guess Data type means binary data that is opaque to ruby. __slave_nsobj__ is a member attribute of Folder. If you can look at yaml and RubyCocoa sources, you'd find more (e.g. what is __slave...).