Ruby
 Tomorrow's language
 today...

Hal Fulton's Ruby Page


If you're looking for information on the book The Ruby Way, this is the place. The second edition was released in November 2006.
          

The Ruby Way

Table of Contents: Here is the TOC in flat text
and here is a Javascript version.

Here is the list of errata.

The source archive is not yet complete!
But you can download the incomplete version (through Chapter 12, or 60%).
Here is a zip file, and here is a tar archive.

Please email me about any errors in the book, the source archive, or this page.



I'm going to help out at Addison-Wesley's Professional Ruby Conference "Voices That Matter", November 17-20, 2008, in Boston.

Use the code PRDPKRL and get $200 off the price.

My Ruby Stuff
comp.lang.ruby FAQ This item isn't "mine"; but I'm the maintainer of the comp.lang.ruby FAQ. The online copy is kept in sync with the one sent out automatically every month.
My Ruby Blog Currently down. I do have a space-related blog at MarsDrive.
Ruby: A Whirlwind Tour Here are the slides from my talk to the Austin Rails Group, January 2006.
Online Articles I've written a couple of Ruby articles, both published on devsource. The more recent one is An Exercise in Metaprogramming with Ruby, which grew from a talk to the Austin Rails Group. In 2005, I wrote Five Things You Didn't Know You Could Do with Ruby at their request.
Tycho: A Ruby-based PIM Here are the slides from this talk I gave at the 2004 Ruby Conference. See also Works in Progress below.
Toward a Refactoring Framework for FreeRIDE Here are the slides from my talk at the 2003 International Ruby Conference in Austin, Texas. The title is a slight misnomer, as the framework is usable for more than refactoring, and I haven't implemented any true automated refactoring anyway. Be sure to read the commentary and view the HTMLized demo at the end.
The Rubyesque API I was honored to be invited to the European Ruby Conference in Karlsruhe, Germany in June of 2003. I gave a talk called "The Rubyesque API"; here is an online version for your perusal.
Ruby for Perl Programmers On 17 April 2002, I gave a talk to the Austin Perlmongers. It was entitled "Ruby for Perl Programmers"; the Powerpoint slides can be found here. If you are using the appropriate platform and browser, you may be able to view these "in place" without downloading. If not, here is an online version (using JPG images). If you'd rather, you can download a zipped version.
Ruby I/O at a Glance When I was working on Chapter 4 of The Ruby Way, I prepared a little chart (for my own use) outlining how input/output works in Ruby. It's probably a little out of date, but still useful, I think. If you see errors or omissions, please let me know. (Yes, it would be a good idea to make each method and class a hyperlink into the docs from Programming Ruby. Sorry, haven't done that yet.)
Thirty-seven Reasons I Love Ruby The 37 Reasons were written long ago, as time on the web goes; I might write them differently now. This was the "page of the day" on the main Ruby site for a couple of months. Update: Be careful what you write. Apparently the 37 Reasons have been translated into Russian. I don't read Russian, but it's got my name on it, and there are 37 items... :)
The First Quines in Ruby The quine, or self-reproducing program, is a long-standing tradition in computer science, and mine are the first in the Ruby language. At least, they're the first I can find reference to. (My reference to Plauger is utterly incorrect.)


Ruby.shop
Visit the Ruby Shop when you have a craving for T-shirts, bumper stickers, and that sort of thing. All artwork, such as it is, is mine. (Yes, I see the nag-message on the graphics. I'll remove it soon.)


Works in Progress
Tycho I'm a big believer in PIMs (Personal Information Managers). Tycho is a project I've started in order to try out my own ideas in this area. Please note this is not meant to be the usual "boring" type of PIM, but a powerful, scriptable, general-purpose information tool in the tradition of Tornado, Info Select, Commence, and Ecco.
Socrates This is yet another app that won't go into the RAA until it's more mature. It's a question-and-answer tool to drill you on a topic until you master it. Here's a screenshot of the overall layout. I'm using FXRuby for now (with expert help from Lyle); I plan to add at least one alternate GUI later. I also plan to beef up the question editor and release it separately. Finally I plan to create a set of questions (you guessed it!) to help people learn Ruby.


Released Code
scanf for Ruby, version 1.1.0 Authored principally by David Alan Black, this was the product of the Austin Ruby Codefest 2002, hosted at my house.
Download it or just view the docs. This is a pure-Ruby implementation of the C function scanf(3). It includes support for the s,c,d,x,o,i, and f specifiers, and character classes. It adds a scanf method to String and IO, and to Kernel (the latter being a wrapper around STDIN.scanf). A common question is: Why didn't we wrap the C function as an extension? One answer is that we just wanted to do it in Ruby, and we found the speed didn't suffer. A better answer is that we wanted to restrict the set of specifiers to a meaningful subset (and perhaps even allow extending the set beyond those available in C).
The Ruby Dependency Tool (rdep), Version 1.4.0 This is a simpleminded tool that tries to determine all the load and require files that a program uses and locate them. It's potentially useful in situations where a large piece of software has many dependencies and sub-dependencies. (I actually wrote it in reaction to my experience with trying to install and configure RD.) There are some little inelegancies in the code, but it seems to work OK. You can view the code or download it. Here's an example of using it on a large Ruby app.


Ruby in Austin
ARCTAN ARCTAN stands for Austin Ruby Coders (Texas Area Network), or something like that. This name will likely change, as I am the only one who likes it. It is expressly meant to include not only the Austin area, but all of Texas.

Join the Yahoo group if you wish. We also tend to meet in person every Thursday at lunch (and plan to start meeting more often in "big" meetings at night once a month). Naturally there is high overlap with the Austin Rails Group.

Ruby has a long history in Austin, Texas, and I have pictures to prove it. This first picture was taken outside the Dog & Duck Pub in April of 2001. Dave Thomas flew down from Dallas to meet us all. Left to right: Dave Thomas; Conrad Schneiker (who created comp.lang.ruby and helped flesh out the structure of The Ruby Way); Suzanne Senay (wife of Mike Stok); Unknown Person 1; Unknown Person 2; Anthony Cagle (?); Mike Stok; and Hal Fulton. If I got any of that wrong, please yell.
This was somehow the only picture taken at the Texas Ruby Codefest in August of 2002. This shows David Alan Black in my library, coding away happily on scanf (see elsewhere on this page). Note the programmer fuel scattered here and there, notably Goldfish, Ginger Snaps, and Oreos. Also in attendance were: Jason Johnston and his girlfriend Erin; Nolan Darilek; myself; and Meg, my cat.


Ruby.limericks
These are probably the only limericks in the world about the Ruby language. Let the reader make his own value judgment in this matter. Disclaimers: The respective creators of Perl, Ruby, and Python do not necessarily know each other or hang out together. We don't necessarily condone promiscuity or animal neurosurgery or Netware.

There once was a language named Ruby
That did wondrous things for the newbie;
The programs they made
Would help them get laid
Even though they were nerdy and gooby.
A Ruby programmer named Earl
Tried to program the brain of a squirrel;
Though he made quite a mess,
We all had to confess
It was still so much cleaner than Perl!
I don't mean to sound like a spammer,
But Ruby has such a neat grammar —
When a task I assail
Starts to look like a nail
Then my code starts to look like a hammer!
Matsumoto and Wall and van Rossum
One day were dissecting a 'possum;
But they found that his wetware
Was all based on Netware
And so they decided to toss 'im.
When Guido and Larry and Matz
Tried to network the brains of two rats
There was only one catch —
An impedance mismatch —
And they fed the results to the cats.


Disclaimer: The word "gogopuffs" is used here in an entirely gratuitous way. Thank you, Randal Schwartz.