Sha256: 483552cfd1df83f47cf2f1574d496764d2ec43c2313d688ec5889fd2343ad299

Contents?: true

Size: 623 Bytes

Versions: 5

Compression:

Stored size: 623 Bytes

Contents

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

  def create
    if selected?(:schedule)
      gather_gem 'sidekiq-scheduler'
      add_readme_section :internal_dependencies, :sidekiq_scheduler
    end
    template '../assets/sidekiq_scheduler.yml', 'config/sidekiq.yml', force: true
  end

  def install
    set(:schedule, true)
    create
  end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
potassium-5.2.3 lib/potassium/recipes/schedule.rb
potassium-5.2.2 lib/potassium/recipes/schedule.rb
potassium-5.2.1 lib/potassium/recipes/schedule.rb
potassium-5.2.0 lib/potassium/recipes/schedule.rb
potassium-5.1.4 lib/potassium/recipes/schedule.rb