Module: Rack::MaintenanceMode::DefaultModeCheck
- Defined in:
- lib/rack/maintenance_mode/default_mode_check.rb
Overview
This is the default behaviour for the gem, with respect to determining whether or not a particular request should be responded to with a maintenance response.
Class Method Summary collapse
-
.call(env) ⇒ Object
With this implementation, maintenance mode will be enabled if there is an ‘ENV` variable set and it has an acceptable value.
Class Method Details
.call(env) ⇒ Object
With this implementation, maintenance mode will be enabled if there is an ‘ENV` variable set and it has an acceptable value.
Acceptable values for MAINTENANCE: on, yes, y, true, t, enable, enabled
If the MAINTENANCE variable is unset or does not match one of the above values, maintenance mode is disabled.
18 19 20 |
# File 'lib/rack/maintenance_mode/default_mode_check.rb', line 18 def self.call(env) ENV["MAINTENANCE"].to_s =~ /^(?:on|yes|y|true|t|enabled?)$/i end |