Where to find a description of yaml for ruby?
···
--
Posted via http://www.ruby-forum.com/.
Where to find a description of yaml for ruby?
--
Posted via http://www.ruby-forum.com/.
Fritz Trapper wrote:
Where to find a description of yaml for ruby?
http://yaml4r.sourceforge.net/doc/
--
Posted via http://www.ruby-forum.com/\.
First hit on a Google search: http://www.yaml.org/
A bit down: YAML - Wikipedia
On 30.12.2009 20:40, Fritz Trapper wrote:
Where to find a description of yaml for ruby?
--
Phillip Gawlowski
Phillip Gawlowski wrote:
On 30.12.2009 20:40, Fritz Trapper 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.
--
Posted via http://www.ruby-forum.com/\.
you, sir, are UNSANE
On Dec 30, 2009, at 21:45 , Albert Schlef 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. ![]()
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! ![]()
On 31.12.2009 06:45, Albert Schlef 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.
--
Phillip Gawlowski
Albert Schlef wrote:
Phillip Gawlowski 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,
On 30.12.2009 20:40, Fritz Trapper wrote:
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
Posted via http://www.ruby-forum.com/\.
Phillip Gawlowski 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.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 varmakes 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!
There's no comparable XML library?
Best,
On 31.12.2009 06:45, Albert Schlef wrote:
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
Posted via http://www.ruby-forum.com/\.
Phillip Gawlowski 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 varmakes 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!
Reading complex data structures expressed in well formated XML is
possible. Reading the same in YAML is at least quite difficult.
--
Posted via http://www.ruby-forum.com/\.
Phillip Gawlowski 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 varmakes 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!
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" ![]()
On 31.12.2009 13:27, Fritz Trapper wrote:
--
Phillip Gawlowski
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.
On Dec 31, 7:27 am, Fritz Trapper <ajfren...@web.de> wrote:
Phillip Gawlowski 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!
Reading complex data structures expressed in well formated XML is
possible. Reading the same in YAML is at least quite difficult.
--
Posted viahttp://www.ruby-forum.com/.
Fritz Trapper wrote:
Phillip Gawlowski 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 varmakes 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!
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
marnen@marnen.org
--
Posted via http://www.ruby-forum.com/\.