Ruby Resources
See
here
for Rails resources.
Primary Resources for Getting Started
Ruby-lang.org
: primary website for the Ruby language
Downloading Ruby
Ruby in Twenty Minutes
: a quick guide to covers key features
Switching to Ruby from...
Java
;
C/C++
Online Books
Programming Ruby
See especially the chapter "Built-in Classes and Methods" for a list of classes provided by Ruby
Why's (Poignant) Guide to Ruby
- maybe not the fastest way to learn Ruby, but probably the most entertaining!
Ruby Cookbook
- code from the Ruby Cookbook; you'll need the book for the explanations
Other Useful Documentation
Ruby problems and their solution
Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby
(Bruno Preiss) - source for various algorithms including
multi-dimensional arrays
Using NetBeans to edit and debug Ruby programs
Debugging Ruby programs on Io
Try running
fxri
(Start->Programs->Ruby...->fxri) installed on the CSSE lab machines.
Ruby Quick-Reference Guide
Ruby 19
release info
Ruby-doc.org
: a collection of useful documents
Core classes
from Ruby-doc.org: "built-in" classes; see especially
Array
,
Bignum
,
Fixnum
,
Float
,
Hash
,
Kernel
,
Math
,
Range
,
Regexp
,
Set
String
,
Test::Unit
,
Time
Sample Programs
grades.rb
: simple program to convert numeric scores to letter grades
gpa.rb
: A slightly more complex program illustrating using arrays, functions, and blocks to process lists of grades.
hicscore.rb
: a full program illustrating Ruby. Running it on
lab0.dat
by the command
ruby hicscore.rb <lab0.dat
gives the output
lab0.out
hist.rb
: read lines from standard input and prints a table showing how often each line occurs. Illustrates basic reading from standard input.
common.rb
: Prints lines that are in common to two files. Illustrates command-line arguments and reading data from files as lines.