Class: Recipes::Schedule

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/potassium/recipes/schedule.rb

Instance Method Summary collapse

Instance Method Details

#askObject



2
3
4
5
6
7
# File 'lib/potassium/recipes/schedule.rb', line 2

def ask
  if selected?(:background_processor)
    response = answer(:schedule) { Ask.confirm("Do you need to schedule jobs?") }
  end
  set(:schedule, response)
end

#createObject



9
10
11
12
13
14
15
# File 'lib/potassium/recipes/schedule.rb', line 9

def create
  if selected?(:schedule)
    gather_gem 'sidekiq-scheduler', '>= 3.0.1'
    add_readme_section :internal_dependencies, :sidekiq_scheduler
    append_schedule_section_to_yml
  end
end

#installObject



17
18
19
20
# File 'lib/potassium/recipes/schedule.rb', line 17

def install
  set(:schedule, true)
  create
end

#installed?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/potassium/recipes/schedule.rb', line 22

def installed?
  gem_exists?(/sidekiq-scheduler/) && file_exist?('config/sidekiq.yml')
end