Class: RuboCop::Cop::Rails::EnvironmentVariableAccess
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Rails::EnvironmentVariableAccess
- Defined in:
- lib/rubocop/cop/rails/environment_variable_access.rb
Overview
Looks for direct access to environment variables through the ‘ENV` variable within the application code. This can lead to runtime errors due to misconfiguration that could have been discovered at boot time if the environment variables were loaded as part of initialization and copied into the application’s configuration or secrets. The cop can be configured to allow either reads or writes if required.
Constant Summary collapse
- READ_MSG =
'Do not read from `ENV` directly post initialization.'
- WRITE_MSG =
'Do not write to `ENV` directly post initialization.'