Skip to content

Instantly share code, notes, and snippets.

@canujohann
Last active October 15, 2015 08:24
Show Gist options
  • Save canujohann/00259c145ec077f01f11 to your computer and use it in GitHub Desktop.
Save canujohann/00259c145ec077f01f11 to your computer and use it in GitHub Desktop.
About rake

Simple rake file

namespace :morning do

  task :default => 'morning:turn_off_alarm'

  desc "Turn off alarm"
  task :turn_off_alarm do
    puts "Turned off alarm. Would have liked 5 more minutes, though."
  end
 
  task :groom_myself do
    puts "Brushed teeth."
    puts "Showered."
    puts "Shaved."
  end
 
  task :make_coffee do
    cups = ENV["COFFEE_CUPS"] || 2
    puts "Made #{cups} cups of coffee. Shakes are gone."
  end
 
  task :walk_dog do
    puts "Dog walked."
  end
 
  task :ready_for_the_day => [:turn_off_alarm, :groom_myself, :make_coffee, :walk_dog] do
    puts "Ready for the day!"
  end
end

Call it :

rake COFFEE_CUPS=3 morning:ready_for_the_day

Site tuto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment