Class: Tomo::Plugin::Cron::Tasks

Inherits:
TaskLibrary
  • Object
show all
Defined in:
lib/tomo/plugin/cron/tasks.rb

Instance Method Summary collapse

Instance Method Details

#install ⇒ Object



9
10
11
12
13
14
15
# File 'lib/tomo/plugin/cron/tasks.rb', line 9

def install
  require_setting :cron_schedule_path

  crontab = Whenever.cron(whenever_options)

  remote.run "echo #{crontab.shellescape} | crontab -"
end

#show ⇒ Object



5
6
7
# File 'lib/tomo/plugin/cron/tasks.rb', line 5

def show
  remote.run "crontab -l", raise_on_error: false
end

#uninstall ⇒ Object



17
18
19
# File 'lib/tomo/plugin/cron/tasks.rb', line 17

def uninstall
  remote.run "crontab -r"
end