mirror of
https://github.com/cmur2/openvpn-status-web.git
synced 2024-12-22 22:54:24 +01:00
gem: make intention of ENV.fetch clear with explicit default value
This commit is contained in:
parent
e3a06fdf6c
commit
057d243db8
@ -9,7 +9,7 @@ require 'yaml'
|
|||||||
require 'rack'
|
require 'rack'
|
||||||
require 'erb'
|
require 'erb'
|
||||||
require 'metriks'
|
require 'metriks'
|
||||||
require 'better_errors' if ENV['RACK_ENV'] == 'development'
|
require 'better_errors' if ENV.fetch('RACK_ENV', nil) == 'development'
|
||||||
|
|
||||||
require 'openvpn-status-web/status'
|
require 'openvpn-status-web/status'
|
||||||
require 'openvpn-status-web/parser/v1'
|
require 'openvpn-status-web/parser/v1'
|
||||||
@ -128,7 +128,7 @@ module OpenVPNStatusWeb
|
|||||||
|
|
||||||
# configure rack
|
# configure rack
|
||||||
app = Daemon.new(config['vpns'])
|
app = Daemon.new(config['vpns'])
|
||||||
if ENV['RACK_ENV'] == 'development'
|
if ENV.fetch('RACK_ENV', nil) == 'development'
|
||||||
app = BetterErrors::Middleware.new(app)
|
app = BetterErrors::Middleware.new(app)
|
||||||
BetterErrors.application_root = File.expand_path(__dir__)
|
BetterErrors.application_root = File.expand_path(__dir__)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user