Where to find a description of yaml for ruby?

Where to find a description of yaml for ruby?

Fritz T. wrote:

Where to find a description of yaml for ruby?

http://yaml4r.sourceforge.net/doc/

On 30.12.2009 20:40, Fritz T. wrote:

Where to find a description of yaml for ruby?

First hit on a Google search: http://www.yaml.org/

A bit down: YAML - Wikipedia

Phillip G. wrote:

On 30.12.2009 20:40, Fritz T. wrote:

Where to find a description of yaml for ruby?

First hit on a Google search: http://www.yaml.org/

A bit down: YAML - Wikipedia

You know, I’m beginning to hate YAML. It loooked deceivingly simple at
first. But it turns out it’s quite complicated. XML is quite simple by
comparison.

On 31.12.2009 06:45, Albert S. wrote:

You know, I’m beginning to hate YAML. It loooked deceivingly simple at
first. But it turns out it’s quite complicated. XML is quite simple by
comparison.

See that guy in the corner? Twitching and twisting? He wrote an ANT
makefile once. :wink:

But one thing is annoying with YAML: Significant whitespace. \t or a
proper space have different meanings, as does the amount of space.

Ain’t it grant that
require “yaml”
var = Object.to_yaml # or dump, if you want to write a file
another_var = YAML.load var

makes it so very easy to use? And it can be read (not necessarily
written) by humans, too.

Try reading and writing XML in just one three lines! :wink:

On Dec 30, 2009, at 21:45 , Albert S. wrote:

You know, I’m beginning to hate YAML. It loooked deceivingly simple at
first. But it turns out it’s quite complicated. XML is quite simple by
comparison.

you, sir, are UNSANE

Phillip G. wrote:

On 31.12.2009 06:45, Albert S. wrote:

You know, I’m beginning to hate YAML. It loooked deceivingly simple at
first. But it turns out it’s quite complicated. XML is quite simple by
comparison.

See that guy in the corner? Twitching and twisting? He wrote an ANT
makefile once. :wink:

But one thing is annoying with YAML: Significant whitespace. \t or a
proper space have different meanings, as does the amount of space.

Tabs are not allowed in Yaml files, precisely in order to cut down
confusion.

The significant indentation is very clear and straightforward. I
actually think it works well in context.

Ain’t it grant that
require “yaml”
var = Object.to_yaml # or dump, if you want to write a file
another_var = YAML.load var

makes it so very easy to use? And it can be read (not necessarily
written) by humans, too.

I find Yaml easy to write…I’d rather write it than XML any day.

Try reading and writing XML in just one three lines! :wink:

There’s no comparable XML library?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Phillip G. wrote:

But one thing is annoying with YAML: Significant whitespace. \t or a
proper space have different meanings, as does the amount of space.

Thats really a bad issue. After reading docs on YAML, I decided to use
it for plane data only, no structs or trees, as I wanted to.

Ain’t it grant that
require “yaml”
var = Object.to_yaml # or dump, if you want to write a file
another_var = YAML.load var

makes it so very easy to use? And it can be read (not necessarily
written) by humans, too.

Yes, that’s very elegant and useful für simple configuration files.

Try reading and writing XML in just one three lines! :wink:

Reading complex data structures expressed in well formated XML is
possible. Reading the same in YAML is at least quite difficult.

Albert S. wrote:

Phillip G. wrote:

On 30.12.2009 20:40, Fritz T. wrote:

Where to find a description of yaml for ruby?

First hit on a Google search: http://www.yaml.org/

A bit down: YAML - Wikipedia

You know, I’m beginning to hate YAML. It loooked deceivingly simple at
first. But it turns out it’s quite complicated. XML is quite simple by
comparison.

Are you kidding? Why do you say this?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On 31.12.2009 13:27, Fritz T. wrote:

Phillip G. wrote:

But one thing is annoying with YAML: Significant whitespace. \t or a
proper space have different meanings, as does the amount of space.

Thats really a bad issue. After reading docs on YAML, I decided to use
it for plane data only, no structs or trees, as I wanted to.

You probably meant “plain data”?

Stupid false friends…

Anyway: Yeah, significant whitespace is an issue. It’s what keeps me
looking at Python off and on (that, and the performance experience of
two of the three Python apps I use is less than stellar).

Ain’t it grant that
require “yaml”
var = Object.to_yaml # or dump, if you want to write a file
another_var = YAML.load var

makes it so very easy to use? And it can be read (not necessarily
written) by humans, too.

Yes, that’s very elegant and useful für simple configuration files.

Or simple data structures, like Hashes and Arrays, or Rails’ test mock
ups.

Try reading and writing XML in just one three lines! :wink:

Reading complex data structures expressed in well formated XML is
possible. Reading the same in YAML is at least quite difficult.

Well, I meant “reading and writing programmatically” :slight_smile:

Fritz T. wrote:

Phillip G. wrote:

But one thing is annoying with YAML: Significant whitespace. \t or a
proper space have different meanings, as does the amount of space.

Thats really a bad issue.

Not at all. I’ve never had a spacing issue in Yaml (except once when I
was using an unfamiliar feature). Have you?

After reading docs on YAML, I decided to use
it for plane data only, no structs or trees, as I wanted to.

Why? I use it for trees and other structures all the time. It’s very
easy to read and write. If you don’t like the indented syntax, you can
use the JSON-like syntax in places where it makes sense.

Ain’t it grant that
require “yaml”
var = Object.to_yaml # or dump, if you want to write a file
another_var = YAML.load var

makes it so very easy to use? And it can be read (not necessarily
written) by humans, too.

Yes, that’s very elegant and useful für simple configuration files.

And for just about anything else.

Try reading and writing XML in just one three lines! :wink:

Reading complex data structures expressed in well formated XML is
possible. Reading the same in YAML is at least quite difficult.

I would usually say the opposite. All the endtags in XML make things
harder for me to read, not easier. And the indentation will be the same
in both pretty XML and Yaml, so no difference there.

Got a concrete example?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Dec 31, 7:27 am, Fritz T. [email protected] wrote:

another_var = YAML.load var

Posted viahttp://www.ruby-forum.com/.

Let me ask you: do you also consider JSON to be more complicated than
XML? Indeed, representing a complex entity would be hellish with mere
hashes, arrays, and scalars. But think about the use case: it is not
intended to be able to represent anything and everything.

Similarly with YAML: yes, it is a fantastic fit for configuration
files. It is a fantastic fit for serializing objects in a
multilingual setting. Can you use it as the basis for your makefile
system? Unlikely… But after a little thought you probably don’t want
to use XML for it, either.

This is my (and probably many others’) problem with XML: it can do
everything, but it’s almost always the wrong tool for the job. For a
simple task, use a simple tool. For a complex task, its probably
easier to create a format/system suited to the task (or just think
about the task differently!) than to devise endless pages of XML
specification.