Sha256: d5f5d7ba330c75038d04ba187dc01b40e3cfe5bd850f965f0256e39f14eab45c

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

# sidekiq
append_file "config/application.yml", <<-EOF
REDIS_HOST: localhost
REDIS_PORT: "6379"
EOF
run "cp config/application.yml config/application.yml.example"
create_file "app/workers/hello_worker.rb", <<-EOF
class HelloWorker
  include Sidekiq::Worker
  sidekiq_options queue: :default

  def perform msg
    puts msg
  end
end
EOF
create_file "config/initializers/sidekiq.rb", <<-EOF
Sidekiq.configure_server do |config|
  config.redis = { :url => "redis://\#{ENV['REDIS_HOST']}:\#{ENV['REDIS_PORT']}/0", :namespace => '#{app_path}' }
end

Sidekiq.configure_client do |config|
  config.redis = { :url => "redis://\#{ENV['REDIS_HOST']}:\#{ENV['REDIS_PORT']}/0", :namespace => '#{app_path}' }
end
EOF
create_file "tmp/pids/.keep", ""
create_file "config/sidekiq.yml", <<-EOF
---
:verbose: true
:pidfile: ./tmp/pids/sidekiq.pid
:logfile: ./log/sidekiq.log
:queues:
  - default
development:
  :concurrency: 1
production:
  :concurrency: 2
EOF
inject_into_file "config/routes.rb", after: "Rails.application.routes.draw do\n" do
<<-EOF
  require 'sidekiq/web'
  authenticate :user do
    mount Sidekiq::Web => '/sidekiq'
  end
EOF
end
run "cp config/sidekiq.yml config/sidekiq.yml.example"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
crosstie-0.0.3 lib/crosstie/templates/sidekiq.rb
crosstie-0.0.2 lib/crosstie/templates/sidekiq.rb