class RuboCop::Cop::Lint::Env

This cops checks for direct usage of ENV variables and Rails.env

Constants

MSG_ENV
MSG_RAILS_ENV
USAGE_MSG

Public Instance Methods

on_const(node) click to toggle source
# File lib/jets/rubocop/cop/lint_env.rb, line 23
def on_const(node)
  return unless env?(node)
  add_offense(node.parent, location: :selector, message: MSG_ENV + USAGE_MSG)
end
on_send(node) click to toggle source
# File lib/jets/rubocop/cop/lint_env.rb, line 28
def on_send(node)
  return unless rails_env?(node)
  add_offense(node.parent, location: :selector, message: MSG_RAILS_ENV + USAGE_MSG)
end