From 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Jun 2020 11:18:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-1-stable-ee --- lib/gitlab.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/gitlab.rb') diff --git a/lib/gitlab.rb b/lib/gitlab.rb index f2bff51df38..43785d165fb 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -36,6 +36,7 @@ module Gitlab end COM_URL = 'https://gitlab.com' + STAGING_COM_URL = 'https://staging.gitlab.com' APP_DIRS_PATTERN = %r{^/?(app|config|ee|lib|spec|\(\w*\))}.freeze SUBDOMAIN_REGEX = %r{\Ahttps://[a-z0-9]+\.gitlab\.com\z}.freeze VERSION = File.read(root.join("VERSION")).strip.freeze @@ -47,6 +48,10 @@ module Gitlab Gitlab.config.gitlab.url == COM_URL || gl_subdomain? end + def self.staging? + Gitlab.config.gitlab.url == STAGING_COM_URL + end + def self.canary? Gitlab::Utils.to_boolean(ENV['CANARY']) end @@ -75,6 +80,10 @@ module Gitlab Rails.env.development? || com? end + def self.dev_or_test_env? + Rails.env.development? || Rails.env.test? + end + def self.ee? @is_ee ||= # We use this method when the Rails environment is not loaded. This -- cgit v1.2.3