Exercises, examples and other material relating to training module R118. This module is presented on Private Courses
and Specially Run Courses
|Articles and tips on this subject||updated|
|3783||Load path, load and require in Ruby, and a change from 1.8 to 1.9|
Ruby loads files through the require command from a list of directories held in the $: special variable, also known as $LOAD_PATH.
Up to and including Ruby 1.8, this path list included . (the current directory) but from Ruby 1.9 it does not.
Here's a sample program:
|2610||Cheat Sheet - what do you need for Ruby on Rails?|
Here is a "cheat sheet" of the commands you might use to install Ruby, then Gems, then Rails, then get your first application and server running.
tar xf ruby-1.9.1-p376.tar.gz
[root@easterton ruby-1.9.1-p376]# ruby -v
|3622||Loading Ruby classes - where does Ruby look?|
If you're loading a Ruby class (or other code) from another source file, use the require function, and give the file name without the .rb on the end of it. Ruby will look in each of the directories listed in $: or $LOAD_PATH in turn, and that list usually includes . (the current directory). See that ...
|3435||Sorta sorting a hash, and what if an exception is NOT thrown - Ruby|
Some gems from last week ...
1. Ruby's begin and rescue clauses allow you to catch anything exceptional that could derail your program. But did you know that you can also add an else clause to be run only in the event of there being no exception? There's an example from last week's Ruby course which ...
|3426||Automed web site testing scripted in Ruby using watir-webdriver|
How do you test your web site? With a visit to a few pages, or by waiting for customer feedback if something's not working? That's a very risky approach, and what you really need is a planned and systematic testing regime, with unit tests that must be passed (but will flag fails) run on a regular basis.
|2931||Syncronise - software, trains, and buses. Please!|
To get from my home to the Divisional Police HQ on another side of Melksham, I can take a five minute bus ride on the X72 or 272, change at the Market Place onto the 234 or X34, and ride for another five minutes. So for a meeting at 19:00, I can catch a bus just after 18:00 to be there in good time, ...
|2621||Ruby collections and strings - some new examples|
From yesterday's Ruby course - a whole set of new examples on Ruby collections - arrays (which are ordered lists) and hashes (which are unordered). In other words, you look somethng up in an array by its position number, whereas you look something up in a hash based on its unique key, and the way it's ...
|550||2006 - Making business a pleasure|
"Making Business a Pleasure" - a spoken logo for Well House Consultants for 2006.
Whether you're attending a course, staying as a guest at Well House Manor, working for us, or simply visiting our web site, we want you to enjoy the experience.
We don't know exactly what 2006 will bring, but we have ...
Examples from our training material
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from [here]
Topics covered in this module
Ruby Central - www.ruby-central.com.
Ruby Application Archive - RAA at http://www.ruby-lang.org/en/raa.html.
Ruby Interactive Reference - RI.
Ruby Development Environment - RDE.
Interactive Ruby - the IRb shell.
Ruby debugging with debug.db and profiling with profile.rb.
Books, Web sites, newgroups, support, etc.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.