Class: Capistrano::Cron
- Inherits:
-
Plugin
- Object
- Plugin
- Capistrano::Cron
show all
- Defined in:
- lib/capistrano/cron.rb,
lib/capistrano/cron/job.rb,
lib/capistrano/cron/version.rb,
lib/capistrano/cron/job_list.rb,
lib/capistrano/cron/numeric_ext.rb,
lib/capistrano/cron/output/cron.rb,
lib/capistrano/cron/output/redirection.rb
Defined Under Namespace
Modules: Output
Classes: Job, JobList, NumericSeconds
Constant Summary
collapse
- VERSION =
"0.1.4"
Instance Method Summary
collapse
Instance Method Details
#clear_crontab ⇒ Object
27
28
29
|
# File 'lib/capistrano/cron.rb', line 27
def clear_crontab
install_crontab("")
end
|
#define_tasks ⇒ Object
14
15
16
|
# File 'lib/capistrano/cron.rb', line 14
def define_tasks
eval_rakefile File.expand_path("../tasks/cron.rake", __FILE__)
end
|
#identifier ⇒ Object
31
32
33
|
# File 'lib/capistrano/cron.rb', line 31
def identifier
fetch(:cron_identifier)
end
|
#register_hooks ⇒ Object
18
19
20
21
|
# File 'lib/capistrano/cron.rb', line 18
def register_hooks
after "deploy:updated", "cron:update"
after "deploy:reverted", "cron:update"
end
|
#set_defaults ⇒ Object
7
8
9
10
11
12
|
# File 'lib/capistrano/cron.rb', line 7
def set_defaults
set_if_empty :cron_roles, %w[db]
set_if_empty :cron_identifier, -> { "#{fetch(:application)}_#{fetch(:stage)}" }
set_if_empty :cron_environment, -> { fetch(:stage) }
set_if_empty :cron_schedule_path, "config/schedule.rb"
end
|
#update_crontab ⇒ Object
23
24
25
|
# File 'lib/capistrano/cron.rb', line 23
def update_crontab
install_crontab(schedule_cron)
end
|