2
간단한 함수를 실행하고 네임 스페이스의 모든 레이크 작업에 enter_to_continue를 실행하고 싶습니다. 현재 모든 단일 태스크의 끝에이 함수를 추가합니다.rake 명령을 사용하여 네임 스페이스의 모든 작업에 함수를 실행하는 방법
그러나이 함수는 enter_to_continue를 실행하여 네임 스페이스 'mytest'의 모든 작업이 끝날 때마다 자동으로 실행되도록하는 방법이 있습니다. 어떤 메타 프로그래밍을하고 있니?
namespace :mytest do
task :foo do
system "date"
enter_to_continue
end
task :bar do
system "ls"
enter_to_continue
end
# ...
# Let's say 10 more tasks ends with enter_to_continue comes after
# ...
end
def enter_to_continue
STDIN.gets.chomp
end