From 40597fdec080d55d36e97aab1a0b98dfc35517b9 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 8 Oct 2019 18:05:56 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- lib/gitlab.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/gitlab.rb') diff --git a/lib/gitlab.rb b/lib/gitlab.rb index 43b3642fd6b..b337f5cbf2c 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'pathname' -require_relative '../config/light_settings' module Gitlab def self.root @@ -38,18 +37,24 @@ 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? - LightSettings.com? + # Check `gl_subdomain?` as well to keep parity with gitlab.com + Gitlab.config.gitlab.url == COM_URL || gl_subdomain? 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 @@ -74,10 +79,6 @@ 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 -- cgit v1.2.3