Syck / Yaml example

hello _why,

Pleased to announce:

       > syck 0.35 |

Yipee!

[snip]

If you’re using Ruby 1.8.0, don’t bother installing
Syck or YAML.rb.They both come with Ruby now.

I use Andy’s one-click installer for Windows and was
wondering if I got the correct version of Syck/Yaml.
Is there a way to verify?

Also, I ran the example:

($:~)$ irb
>> require 'syck'
=> true
>> yp = YAML::Syck::Parser.new( {} )
=> #<YAML::Syck::Parser:0x8058530>
>> yp.load( File.open( 'syck-0.35.yml' ) )
=> {"status"=>"Syck is about 60% compliant ..."}

but had to modify it slightly:

s = File.open( ‘syck-0.35.yml’ ).readlines.join
p yp.load(s)

Pretty cool !!

As always, my love is unwavering.

_why

No doubt :wink:
– shanko

···

Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook™.
http://calendar.yahoo.com

I use Andy’s one-click installer for Windows and was
wondering if I got the correct version of Syck/Yaml.
Is there a way to verify?

The installer is a week or so behind of CVS. You’ll have to wait for an
update or find someone who has compiled the latest Ruby source on Windows.

but had to modify it slightly:

s = File.open( ‘syck-0.35.yml’ ).readlines.join
p yp.load(s)

Yeah, that example should actually be:

s = YAML::load( File::open( ‘syck-0.35.yml’ ) )

(or)

s = YAML::load( File::open( ‘syck-0.35.yml’ ).read )

You can stream from a file or from a string. See YAML.rb docs at
http://yaml4r.sf.net/doc/. Good luck.

_why

···

On Thursday 05 June 2003 03:57 pm, Shashank Date wrote:

_why,

···

-----Original Message-----
From: why the lucky stiff [mailto:ruby-talk@whytheluckystiff.net]
Sent: Thursday, June 05, 2003 00:41

'arse error on line 1, col 6: ` code: “00000000001”

Yes. This was a known bug on ruby-core. A fix was checked into CVS
a few days ago. The bad news is you’ll need to find someone who can
build a new Ruby-1.8 on Windows. :frowning:

I’ve just built Ruby-1.8 from CVS and the problem is still there –
it does not work with .yml files in DOS format, but works fine after
I convert them to Unix format. :frowning:

Yura.

Sorry, Yura, this has not been completed yet.

You can follow along with Syck’s status on its homepage
[http://www.whytheluckystiff.net/syck/]. On the progress meter, you’ll see
that “CR-LF Normalization” is still red. Once this is green, Syck will be
accepting DOS newlines.

_why

···

On Sunday 08 June 2003 11:48 am, Yura wrote:

I’ve just built Ruby-1.8 from CVS and the problem is still there –
it does not work with .yml files in DOS format, but works fine after
I convert them to Unix format. :frowning: