Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab.rb')
-rw-r--r--lib/gitlab.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb
index 2449554d3c0..d33120575a2 100644
--- a/lib/gitlab.rb
+++ b/lib/gitlab.rb
@@ -49,9 +49,15 @@ module Gitlab
INSTALLATION_TYPE = File.read(root.join("INSTALLATION_TYPE")).strip.freeze
HTTP_PROXY_ENV_VARS = %w(http_proxy https_proxy HTTP_PROXY HTTPS_PROXY).freeze
+ def self.simulate_com?
+ return false unless Rails.env.development?
+
+ Gitlab::Utils.to_boolean(ENV['GITLAB_SIMULATE_SAAS'])
+ end
+
def self.com?
# Check `gl_subdomain?` as well to keep parity with gitlab.com
- Gitlab.config.gitlab.url == Gitlab::Saas.com_url || gl_subdomain?
+ simulate_com? || Gitlab.config.gitlab.url == Gitlab::Saas.com_url || gl_subdomain?
end
def self.com
@@ -82,12 +88,8 @@ module Gitlab
Gitlab::Saas.subdomain_regex === Gitlab.config.gitlab.url
end
- def self.dev_env_org_or_com?
- dev_env_or_com? || org?
- end
-
- def self.dev_env_or_com?
- Rails.env.development? || com?
+ def self.org_or_com?
+ org? || com?
end
def self.dev_or_test_env?