Ruby Cheat Sheets

Post by Peter Cooper

Permanent Link  |   book mark Ruby Cheat Sheets in del.icio.usDel.icio.us  |   See this page in technoratiCosmos

Ruby is an incredibly easy language to learn, but it’s still often necessary to look up something we’ve forgotten. Often this can be done by using Google or using any Ruby books we have on our shelves, but sometimes it’s handy to refer to a simpler set of notes, such as a “cheat sheet.” Quite a few Ruby developers have made cheat sheets for Ruby, and this post attempts to cover the most interesting ones.

The idea for this initial list (Don’t worry, Rails will be covered later on) came from Scott Klarr’s own list. Scott has been quite prolific lately in putting together lists of cheat sheets. Some of his lists are: Apache cheat sheets, MySQL cheat sheets, PHP cheat sheets, and JavaScript / AJAX cheat sheets.

But.. on with the Ruby cheat sheets:

Ruby Cheatsheet (PDF and PNG)

rubycheat.png

This cheat sheet (homepage) covers types, exceptions, expressions, variable types, operators and precedence, constants, regular expressions, predefined / special variables, arguments accepted by the Ruby interpreter, reserved words, and a large collection of Object, String, Kernel, Array, Hash, Test::Unit, File, Dir and DateTime methods. Extremely suitable for printing and/or wall chart use.

Ruby QuickRef (HTML)

rubyquickref.png

I often use this one myself! A ridiculously comprehensive “cheat sheet” created by Ryan Davis covering syntax rules, reserved words, regular expression terminology, class and method definitions, predefined variables and constants, control and logic expressions and formations, exceptions, the standard library, and a whole ton of useful stuff.

Ruby Reference (PDF)

rubycheatsheet.png

More of an extremely brief reference than a truly comprehensive cheat sheet, but still useful, especially for beginners. 5 pages long, so not suitable for printing (Also available to view on the Web at Scribd.)

Cheat: Ruby Cheat Sheets on your Terminal! (Application)

errcheat.png

Not a cheat sheet, but an application (gem install cheat) that provides cheat sheet type reference material on your terminal (from 228 source cheat sheets!) Developed by the great guys over at Err Free.

A Beginner’s Notes (HTML)

beginnersnotes.png

A set of notes made by a beginning Ruby developer as he works his way through a Ruby manual.

Ruby Command Line Parameters Cheat Sheet (HTML)

A simplified list of the command line options offered by the Ruby interpreter.

Strftime Parameters (HTML)

A handy guide to the formatting parameters accepted by strftime. I commonly have to look these up myself!

6 Responses to “Ruby Cheat Sheets”

  1. #1
    Ivan Says:

    I bought Ruby Pocket reference for $9 from O’Reilly. It’s much better than any cheat sheet.

  2. #2
    pfig Says:

    i use ruby in a nutshell, beats any cheat sheet.

  3. #3
    piyo Says:

    I want a rake cheat sheet. Like what can I call with a task object, how to declare variables, a “best practices” template.

  4. #4
    Mark Thomas Says:

    I’d like to see a Test::Unit and/or rspec cheat sheet.

  5. #5
    mvohra Says:

    Interesting collection, add this one to the list as well. This is part 1

  6. #6
    doug livesey Says:

    I’ll second the request for an RSpec cheat sheet