Skip to content

Instantly share code, notes, and snippets.

@chsh
Created January 23, 2022 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chsh/afbc69064288a740d575134ceb28329a to your computer and use it in GitHub Desktop.
Save chsh/afbc69064288a740d575134ceb28329a to your computer and use it in GitHub Desktop.
rails template with goo_job
# rails basic configuration
environment_development_data = <<CODE
config.action_mailer.default_url_options = { host: 'http://localhost:3000' }
config.active_job.queue_adapter = :good_job
CODE
environment environment_development_data, env: 'development'
environment_production_data = <<CODE
config.action_mailer.default_url_options = { host: 'SET-YOUR-SERVICE-HOST-HERE' }
CODE
environment environment_production_data, env: 'production'
environment <<-CODE
config.time_zone = 'Tokyo'
config.active_job.queue_adapter = :good_job
config.good_job.queues = '*'
config.generators do |g|
g.helper false
end
config.i18n.enforce_available_locales = true
config.i18n.available_locales = %w(ja en)
config.i18n.default_locale = :ja
CODE
# gems
gem 'slim-rails'
gem 'good_job'
run 'bundle install'
generate 'good_job:install'
rails_command 'db:migrate'
file "Procfile.dev", <<~CODE
server: bundle exec bin/rails server -p 3000
job: bundle exec good_job start
CODE
# after bundle install
after_bundle do
git :init
git add: '.'
git commit: %Q{ -m 'Initial commit' }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment