Class: GovukPublishingComponents::AppHelpers::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/govuk_publishing_components/app_helpers/environment.rb

Constant Summary collapse

GOVUK_ENVIRONMENTS =
%w[integration staging production].freeze

Class Method Summary collapse

Class Method Details

.current_acceptance_environmentObject

The “acceptance environment” we’re in - not the same as Rails env. Can be “production”, “staging”, “integration”, “development” or “example” (if running on Heroku)



8
9
10
11
12
# File 'lib/govuk_publishing_components/app_helpers/environment.rb', line 8

def self.current_acceptance_environment
  return "example" if ENV["HEROKU"]

  GOVUK_ENVIRONMENTS.include?(ENV["GOVUK_ENVIRONMENT_NAME"]) ? ENV["GOVUK_ENVIRONMENT_NAME"] : "development"
end