Class: RuboCop::Cop::Betterment::EnvironmentConfiguration

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/betterment/environment_configuration.rb

Constant Summary collapse

MSG =
"Environment variables should be parsed at boot time and assigned " \
"to `Rails.configuration` or some other configurable object."

Instance Method Summary collapse

Instance Method Details

#env?(node) ⇒ Object



12
# File 'lib/rubocop/cop/betterment/environment_configuration.rb', line 12

def_node_matcher :env?, '(const nil? :ENV)'

#on_const(node) ⇒ Object



14
15
16
# File 'lib/rubocop/cop/betterment/environment_configuration.rb', line 14

def on_const(node)
  add_offense(node) if env?(node)
end