summaryrefslogtreecommitdiff
path: root/lib/gitlab.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab.rb')
-rw-r--r--lib/gitlab.rb9
1 files changed, 9 insertions, 0 deletions
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