Skip to content

Commit

Permalink
Move the rest of RACK_ENV stuff to APP_ENV.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Dec 27, 2017
1 parent a4d70f0 commit 4b265ae
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .dockerenv.example
@@ -1,4 +1,4 @@
RACK_ENV=deployment
APP_ENV=development

REDIS_URL=redis://redis:6379

Expand Down
6 changes: 3 additions & 3 deletions Rakefile
@@ -1,13 +1,13 @@
# frozen_string_literal: true

ENV["RACK_ENV"] ||= "development"
ENV["APP_ENV"] ||= "development"

# Load secure_headers rake task
require "bundler/setup"
Bundler.require(:default, ENV["RACK_ENV"])
Bundler.require(:default, ENV["APP_ENV"])
load "tasks/tasks.rake"

if ENV["RACK_ENV"] == "development"
if ENV["APP_ENV"] == "development"
require "github-release-party/tasks/heroku"
end

Expand Down
4 changes: 2 additions & 2 deletions config/application.rb
@@ -1,9 +1,9 @@
# frozen_string_literal: true

ENV["RACK_ENV"] ||= "development"
ENV["APP_ENV"] ||= "development"

require "bundler/setup"
Bundler.require(:default, ENV["RACK_ENV"])
Bundler.require(:default, ENV["APP_ENV"])

# uncomment to get production error pages in development
# set :environment, :production
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/10-secure_headers.rb
Expand Up @@ -23,7 +23,7 @@
config.csp[:report_uri] = ENV["CSP_REPORT_URI"].split(",") if ENV["CSP_REPORT_URI"]

# Allow unsafe-inline for better_errors in development mode
if ENV["RACK_ENV"] == "development"
if ENV["APP_ENV"] == "development"
config.csp.merge!({
script_src: %w('unsafe-inline'),
style_src: %w('unsafe-inline'),
Expand All @@ -49,7 +49,7 @@
})

# Allow unsafe-inline for better_errors in development mode
if ENV["RACK_ENV"] == "development"
if ENV["APP_ENV"] == "development"
config.csp[:script_src] << "'unsafe-inline'"
config.csp[:style_src] << "'unsafe-inline'"
end
Expand Down
6 changes: 3 additions & 3 deletions config/puma.rb
@@ -1,9 +1,9 @@
# frozen_string_literal: true

ENV["RACK_ENV"] ||= "development"
environment(ENV["RACK_ENV"])
ENV["APP_ENV"] ||= "development"
environment(ENV["APP_ENV"])

if ENV["RACK_ENV"] == "development"
if ENV["APP_ENV"] == "development"
# better_errors and binding_of_caller works better with only one process and thread
workers(1)
threads(1, 1)
Expand Down
4 changes: 2 additions & 2 deletions config/unicorn.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true

ENV["RACK_ENV"] ||= "development"
if ENV["RACK_ENV"] == "development"
ENV["APP_ENV"] ||= "development"
if ENV["APP_ENV"] == "development"
# better_errors and binding_of_caller works better with only one process
worker_processes 1
else
Expand Down

0 comments on commit 4b265ae

Please sign in to comment.