summaryrefslogtreecommitdiff
path: root/lib/gitlab.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 00:05:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 00:05:59 +0000
commit427b23c12718bea233931431e7d9307881a960c0 (patch)
tree5e15672783c950a5e68dd89517d7888e652e01a7 /lib/gitlab.rb
parent6d60f910762c1a92a07a4afaf1b26962f75ee4b6 (diff)
downloadgitlab-ce-427b23c12718bea233931431e7d9307881a960c0.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab.rb')
-rw-r--r--lib/gitlab.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb
index b337f5cbf2c..43b3642fd6b 100644
--- a/lib/gitlab.rb
+++ b/lib/gitlab.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require 'pathname'
+require_relative '../config/light_settings'
module Gitlab
def self.root
@@ -37,24 +38,18 @@ module Gitlab
COM_URL = 'https://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
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.com?
- # Check `gl_subdomain?` as well to keep parity with gitlab.com
- Gitlab.config.gitlab.url == COM_URL || gl_subdomain?
+ LightSettings.com?
end
def self.org?
Gitlab.config.gitlab.url == 'https://dev.gitlab.org'
end
- def self.gl_subdomain?
- SUBDOMAIN_REGEX === Gitlab.config.gitlab.url
- end
-
def self.dev_env_org_or_com?
dev_env_or_com? || org?
end
@@ -79,6 +74,10 @@ module Gitlab
yield if ee?
end
+ def self.com
+ yield if com?
+ end
+
def self.http_proxy_env?
HTTP_PROXY_ENV_VARS.any? { |name| ENV[name] }
end