From the previous chapter, you should now be relatively comfortable with irb and how Ruby deals with various expressions. Now we’ll try some Ruby programs that are stored in separate files and executed outside of irb. You can download all of these programs at http://www.nostarch.com/ruby.htm.
We’ll run our programs with the
ruby command, so when we want to run a script called
check_payday.rb, we’ll type
ruby check_payday.rb either at the shell in a Unix-like system or at the command prompt in Windows. We’ll also generally use the
-w option, which means turn warnings on, making our example above become