Is there a definitive reference document for Ruby syntax?

Posted by JSW on Stack Overflow See other posts from Stack Overflow or by JSW
Published on 2010-05-02T19:32:42Z Indexed on 2010/05/02 19:38 UTC
Read the original article Hit count: 240

Filed under:
|
|

I'm searching for a definitive document on Ruby syntax. I know about the definitive documents for the core API and standard library, but what about the syntax itself? For instance, such a document should cover: reserved words, string literals syntax, naming rules for variables/classes/modules, all the conditional statements and their permutations, and so forth.

I know there are many books and tutorials, yes, but every one of them is essentially a tutorial, each one having a range of different depth and focus. They will all, by necessity of brevity and narrative flow, omit certain details of the language that the author deems insignificant.

For instance, did you know that you can use a case statement without an initial case value, and it will then execute the first true when clause? Any given Ruby book or tutorial may or may not cover that particular lesser-known functionality of the case syntax. It's not discussed in the section in "Programming Ruby" about case statements. But that is just one small example.

So far the best documentation I've found is the rubyspec project, which appears to be an attempt to write a complete test suite for the language. That's not bad, but it's a bit hard to use from a practical standpoint as a developer working on my own projects.

Am I just missing something or is there really no definitive readable document defining the whole of Ruby syntax?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about documentation