【发布时间】:2011-09-15 10:16:57
【问题描述】:
我正在使用 Ruby on Rails 和 Capistrano gem。我想干燥(不要重复自己)Capistrano 食谱。
在deploy.rb 文件中我有:
# First task
task :first_task do
...
run "cd #{current_path}; #{try_sudo} chmod -R 666 /log/production.log"
end
# Second task
task :second_task do
run "..."
# The following code is equal to that stated in the first task.
run "cd #{current_path}; #{try_sudo} chmod -R 666 /log/production.log"
end
那么,我怎样才能干掉上面的代码,以免重复任务?
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3 capistrano recipe