From: unbewusst Date: 2007-08-30T18:10:04+09:00 Subject: Re: problem with yaml On 28 ao�t, 17:39, "Jano Svitok" wrote: > 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...). OK, thanks i'll avoid that Data {}