More Structure

Goals

  • Add another file to our repository

Now add a Rakefile

This lab assumes you have installed rake. Please do that before continuing. Check for your specific Operating System. Otherwise execute:

Execute:

  1. gem install rake

Let’s add a Rakefile to our repository. The following one will do nicely.

Rakefile

  1. #!/usr/bin/ruby -wKU
  2. task :default => :run
  3. task :run do
  4. require './lib/hello'
  5. end

Add and commit the change.

Execute:

  1. git add Rakefile
  2. git commit -m "Added a Rakefile."

You should be able to use Rake to run your hello program now.

Execute:

  1. rake

Output:

  1. $ rake
  2. Hello, World!