From c286c66f57e4fd716fe1746363f8c7cf4205cee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 10 Apr 2018 16:07:47 +0200 Subject: Move Settings to its own file, isolate it from Rails and introduce Gitlab.root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- lib/gitlab.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/gitlab.rb') diff --git a/lib/gitlab.rb b/lib/gitlab.rb index f6629982512..a51ea0afbd9 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -5,6 +5,10 @@ module Gitlab APP_DIRS_PATTERN = %r{^/?(app|config|ee|lib|spec|\(\w*\))} SUBDOMAIN_REGEX = %r{\Ahttps://[a-z0-9]+\.gitlab\.com\z} + def self.root + Pathname.new(File.expand_path('..', __dir__)) + end + def self.com? # Check `gl_subdomain?` as well to keep parity with gitlab.com Gitlab.config.gitlab.url == COM_URL || gl_subdomain? -- cgit v1.2.1