Module: Cybele::Helpers::Sidekiq

Included in:
AppBuilder
Defined in:
lib/cybele/helpers/sidekiq.rb

Instance Method Summary collapse

Instance Method Details

#configure_sidekiqObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cybele/helpers/sidekiq.rb', line 6

def configure_sidekiq
  # Add gems
  append_file('Gemfile', template_content('sidekiq/sidekiq_Gemfile.erb'))

  create_sidekiq_files

  # Add sidekiq routes to routes
  prepend_file 'config/routes.rb',
               template_content('sidekiq/sidekiq_routes_require.erb')
  inject_into_file 'config/routes.rb',
                   template_content('sidekiq/sidekiq_routes_mount.erb'),
                   after: 'Rails.application.routes.draw do'
  inject_into_file 'config/application.rb',
                   template_content('sidekiq/sidekiq_application.rb.erb'),
                   after: 'class Application < Rails::Application'
end