Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 1.04 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. directory "tmp"
  2.  
  3. file "tmp/hello.tmp" => "tmp" do
  4.   sh "echo 'Hello' > 'tmp/hello.tmp'"
  5. end
  6.  
  7. task :default => 'morning:turn_off_alarm'
  8.  
  9. namespace :morning do
  10.   desc "Turn off alarm."
  11.   task :turn_off_alarm do
  12.     puts "Turned off alarm. Would have liked 5 more minutes, though."
  13.   end
  14.  
  15.   desc "Take care of normal hygeine tasks."
  16.   task :groom_myself do
  17.     puts "Brushed teeth."
  18.     puts "Showered."
  19.     puts "Shaved."
  20.   end
  21.  
  22.   desc "Make coffee"
  23.   task :make_coffee do
  24.     cups = ENV["COFFEE_CUPS"] || 2
  25.     puts "Made #{cups} cups of coffee. Shakes are gone."
  26.   end
  27.  
  28.   desc "Walk the dog"
  29.   task :walk_dog do
  30.     puts "Dog walked."
  31.   end
  32.  
  33.   desc "Get ready for the day"
  34.   task :ready_for_the_day => [:turn_off_alarm, :groom_myself, :make_coffee, :walk_dog] do
  35.     puts "Ready for the day!"
  36.   end
  37. end
  38.  
  39. namespace :morning do
  40.   task :groom_myself do
  41.     puts "Styled hair."
  42.   end
  43. end
  44.  
  45. namespace :afternoon do
  46.   desc "Make afternoon coffee"
  47.   task :make_coffee do
  48.     Rake::Task['morning:make_coffee'].invoke
  49.     puts "Ready for the rest of the day!"
  50.   end
  51. end