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.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