Module: HostOS::Env
- Defined in:
- lib/host-os.rb
Overview
When no environment is configured ‘prod
This module allows to identify the current environment by checking the ‘ENV` for the following variables in order:
-
RAILS_ENV
-
RACK_ENV
-
ENVIRONMENT
-
ENV
You can check for any boolean attribute:
Constant Summary collapse
- ID =
Returns environment identifier.
identify
Class Attribute Summary collapse
-
.development? ⇒ true, false
readonly
Whether the environment is configured as “development”.
-
.id ⇒ Symbol
readonly
Environment identifier.
-
.production? ⇒ true, false
readonly
Whether the environment is configured as “production”.
-
.test? ⇒ true, false
readonly
Whether the environment is configured as “test”.
Class Method Summary collapse
-
.is?(what) ⇒ true, false
Whether the environment is the given identifier.
Class Attribute Details
.development? ⇒ true, false (readonly)
Returns whether the environment is configured as “development”.
|
# File 'lib/host-os.rb', line 61
|
.id ⇒ Symbol (readonly)
Returns environment identifier.
67 68 69 |
# File 'lib/host-os.rb', line 67 def id ID end |
.production? ⇒ true, false (readonly)
This will return true if the environment is not configured.
Returns whether the environment is configured as “production”.
|
# File 'lib/host-os.rb', line 54
|
.test? ⇒ true, false (readonly)
Returns whether the environment is configured as “test”.
|
# File 'lib/host-os.rb', line 58
|
Class Method Details
.is?(what) ⇒ true, false
Returns whether the environment is the given identifier.
|
# File 'lib/host-os.rb', line 71
|