module Rails

def env

Rails.env.local? # => true true for "development" and "test", false for anything else
Rails.env.production? # => false
Rails.env.development? # => true
Rails.env # => "development"

Returns the current \Rails environment.
def env
  @_env ||= ActiveSupport::EnvironmentInquirer.new(ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development")
end