Problem with yaml

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:inobject_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:intransfer’
from /usr/lib/ruby/1.8/yaml.rb:119:in load' from /usr/lib/ruby/1.8/yaml.rb:119:inload’
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…

On 8/28/07, unbewusst [email protected] wrote:

    from /usr/lib/ruby/1.8/yaml.rb:119:in `load'

    - !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…).

On 28 août, 17:39, “Jano S.” [email protected] wrote:

    from /usr/lib/ruby/1.8/yaml/rubytypes.rb:36
  enabled: -1

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 {}

On 28 août, 17:39, “Jano S.” [email protected] wrote:

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.

in fact, i’m using severall Folders BUT it is only the outermost
staying with this “slave_nsobj” i’ve carefully verified that my
Folder class doesn’t use anymore NSSomething…

as for example NSString, i’ve make use of something.to_s to avoid
NSString

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs