: 
http://rubylearning.com/
http://rubylearning.com/satishtalim/tutorial.html
http://rubylearning.com/download/downloads.html
http://rubylearning.com/other/certification.html
http://rubylearning.com/blog/
http://rubylearning.com/other/ruby_news.html
http://rubylearning.com/other/testimonials.html
http://rubylearning.com/jobs/ruby_jobs.html
http://rubylearning.com/other/ruby_gurus.html
http://rubylearning.com/satishtalim/services.html
http://rubylearning.com/contact/contact.html
http://rubylearning.com/satishtalim/about.html


Ruby Tools

I have not gone into the details of some of the important tools that Ruby provides for programmers. Here's a brief idea:

irb

irb is an interactive interpreter - which means that instead of processing a file, it processes what you type during a session. irb is a great tool for testing Ruby code and for learning Ruby. Since I am using SciTE, I have not gone into the details of irb. You can refer to this and this resource for details of irb.

The debugger

Debugging - fixing errors - is part of programming. The Ruby debugging facility (found in the library file debug.rb) helps you debug a program by letting you run the program one instruction at a time, with pauses in between. During the pauses, you are presented with a prompt; at this prompt, you can examine the values of variables, see where you are in a nested series of commands, and resume execution. You can also set breakpoints - places in your program where the debugger stops execution and presents you with a prompt. You can refer to this and this resource for details of the debugger.

Profiling

In programming terms, profiling means measuring how much use is made of system resources - time, principally - by different parts of your program. This starts to matter with longer programs, particularly programs that involve looping through instructions many times (for example, a program that reads in a long file and examines or modifies the contents of each line as it's read in). None of the examples on this site require profiling, because they're short and simple.

 

Profiling pinpoints the spots in a program that are using lots of system resources and therefore potentially slowing the program. The information provided by the profiler may lead you to tweak part of a program to make it run more efficiently; or, if there's no relatively easy way around the resource bottleneck, it may lead you to rewrite part of the program in C, to make it run faster. You can refer to this resource for details of profiling Ruby code.

ri and RDoc

ri (Ruby Index) and RDoc (Ruby Documentation) are a closely related pair of tools for providing documentation about Ruby programs. ri is a command-line tool; the RDoc system includes the command-line tool rdoc. ri and rdoc are standalone programs; you run them from the command line.

 

RDoc is a documentation system. If you put comments in your program files (Ruby or C) in the prescribed RDoc format, rdoc scans your files, extracts the comments, organizes them intelligently (indexed according to what they comment on), and creates nicely formatted documentation from them. You can see RDoc markup in many of the C files in the Ruby source tree and many of the Ruby files in the Ruby installation.

 

ri dovetails with RDoc: It gives you a way to view the information that RDoc has extracted and organized. Specifically (although not exclusively, if you customize it), ri is configured to display the RDoc information from the Ruby source files. Thus on any system that has Ruby fully installed, you can get detailed information about Ruby with a simple command-line invocation of ri. Some more information is available here.

ERb

Ruby provides you with a program called ERb (Embedded Ruby), written by Seki Masatoshi. ERb allows you to put Ruby code inside an HTML file.

 

ERb reads a file-an ERb document-and prints it out again. You're allowed to insert Ruby programming instructions in the document (using a special syntax). When ERb hits the Ruby instructions, it executes them. Depending on what you've asked for, it either moves on or prints out the results of executing the instructions.

 

ERb looms very large in the Ruby on Rails framework. Essentially, what you see on the screen when you connect to a Rails application is, in many cases, the output from an ERb document.


ERb looms very large in the Ruby on Rails framework. Essentially, what you see on the screen when you connect to a Rails application is, in many cases, the output from an ERb document.


Some more information is available here.

 

All the details on this page have been adapted from David Black's very informative book, Ruby For Rails.



Learning Ruby Navigation                                                                               <Unit Testing  | TOC  |  Java to Ruby>