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
Turned off alarm. Would have liked 5 more minutes, though. Brushed teeth. Showered. Shaved. Made 5 cups of coffee. Shakes are gone. Dog walked. Ready for the day!
namespace :morning do task :turn_of_alarm .... end
task :default => 'morning:turn_off_alarm'
...
desc "Make coffee"
task :make_coffee do
cups = ENV["COFFEE_CUPS"] || 2
puts "Made #{cups} cups of coffee. Shakes are gone."
end
...
rake morning:make_coffee # Make coffee
namespace :afternoon do task :make_coffee do Rake::Task['morning:make_coffee'].invoke puts "Ready for the rest of the day!" end end
desc "任务1 -- 搭车去车车那里"#这据说是个苦差,因为太远了 task :busboy do puts "发现挫男" end desc "任务2 -- 烤鱼" task :bitchfish do puts "老板,先烤九斤鱼" end desc "任务3 -- 网吧PC" task :pc do puts "我选中路" end
D:work>rake busboy (in D:/work) 发现挫男 D:work>rake bitchfish (in D:/work) 老板,先烤九斤鱼 D:workruby_worksruby_book>rake laundry (in D:/work) 我选中路
D:work>rake --tasks (in D:/work) rake bitchfish #任务2 -- 烤鱼 rake busboy #任务1 -- 搭车去车车那里(这据说是个苦差,因为太远了) rake pc 任务3 -- 网吧PC
puts "发现挫男"
desc "任务1 -- 搭车去车车那里" task :busboy do puts "发现挫男" end desc "任务2 -- 烤鱼" task :bitchfish => :busboy do puts "老板,先烤九斤鱼" end desc "任务3 -- 网吧PC" task :pc do puts "我选中路" end
D:work>rake bitchfish (in D:/work) 发现挫男 老板,先烤九斤鱼
namespace :dan do desc "任务1 -- 搭车去车车那里" task :busboy do puts "发现挫男" end …… end
D:work >rake --tasks (in D:/work) rake dan:bitchfish # 任务2 -- 烤鱼 rake dan:pc # 任务3 -- 网吧PC rake dan:busboy # 任务1 -- 搭车去车车那里
desc "今天的任务" task :today do Rake::Task["dan:bitchfish"].invoke Rake::Task["dan:pc"].invoke end namespace :dan do …… end
Rake::Task["task_name"].invoke
D:work >rake today (in D:/work) 发现挫男 老板,先烤九斤鱼 我选中路
task :default => [:today]
task :default => [:today] desc "今天的任务" task :today do Rake::Task["dan:bitchfish"].invoke Rake::Task["dan:pc"].invoke end namesoace :dan do desc "任务1 -- 搭车去车车那里(这据说是个苦差,因为太远了)" task :busboy do puts "发现挫男" end desc "任务2 -- 烤鱼" task :bitchfish do puts "老板,先烤九斤鱼" end desc "任务3 -- 网吧PC" task :pc do puts "我选中路" end end
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有