Class: Recipes::Puma

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

Instance Method Summary collapse

Instance Method Details

#createObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/potassium/recipes/puma.rb', line 2

def create
  gather_gems(:production) do
    gather_gem 'rack-timeout'
  end

  copy_file '../assets/config/puma.rb', 'config/puma.rb', force: true

  # Configure rack-timout
  rack_timeout_config =
    <<-RUBY.gsub(/^ {9}/, '')
       Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
       RUBY

  append_file "config/environments/production.rb", rack_timeout_config
end