[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: YAML doesn't seem to be working properly

Robert Klemme

9/10/2008 2:09:00 PM

2008/9/10 Eric Gerlach <eric-ruby-talk@gerlach.ca>:
> Hi,
>
> I'm trying to marshal some data using Ruby's YAML library, but the files
> that YAML.rb is creating aren't loading up properly. I've brought in
> the libraries from the most recent 1.8.6 branch, but the problem isn't
> solved there.
>
> I've attached a stub script which demonstrates the problem. If someone
> who has 1.8.7 can test it and let me know the results, that would be a
> huge help. (The script should print some stuff and *not* crash out with
> an exception).
>
> Unless, of course, this is a known bug, in which case feel free to just
> tell me to upgrade to whatever version is necessary. :-)
>
> Thanks in advance for your help!

No luck:

16:08:53 JBoss$ /c/Temp/yam2.rb
1.8.7
//padwcl2/home/RKlemme/lib/ruby:/usr/lib/ruby/site_ruby/1.8:/usr/lib/ruby/site_ruby/1.8/i386-cygwin:/usr/lib/ruby/site_ruby:/usr/lib/ruby/vendor_ruby/1.8:/usr/lib/ruby/vendor_ruby/1.8/i386-cygwin:/usr/lib/ruby/vendor_ruby:/usr/lib/ruby/1.8:/usr/lib/ruby/1.8/i386-cygwin:.#<Test1:0x7ff0673c
@f1="Test",
@p=nil,
@z=
[#<Test1:0x7ff065fc
@f1="Test2",
@p=#<Test1:0x7ff0673c ...>,
@z=[#<Test1:0x7ff065c0 @f1="Test3", @p=#<Test1:0x7ff065fc ...>>]>]>
#<Test1:0x7ff04810
@f1="Test",
@p=nil,
@z=[#<Test1:0x7ff04428 @f1="Test2", @p=#<Test1:0x7ff04810 ...>, @z=nil>]>
Test3
/c/Temp/yam2.rb:32: undefined method `[]' for nil:NilClass (NoMethodError)

Cheers

robert

--
use.inject do |as, often| as.you_can - without end