0
我正在使用Ruby on Rails和Capistrano創業板。我想幹(不要重複自己)一個Capistrano食譜。如何烘乾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
那麼,如何我乾的上述代碼,以便有沒有重複的任務?