diff options
author | Rémy Coutable <remy@rymai.me> | 2018-04-10 16:07:47 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-04-23 12:20:30 +0200 |
commit | c286c66f57e4fd716fe1746363f8c7cf4205cee3 (patch) | |
tree | fb2b9bc7c1c157bd1ca76051ce4c3c831e8d4b33 /lib/gitlab.rb | |
parent | fe919f95b140f95ffcefc6f7fbfd0e7b1da43016 (diff) | |
download | gitlab-ce-c286c66f57e4fd716fe1746363f8c7cf4205cee3.tar.gz |
Move Settings to its own file, isolate it from Rails and introduce Gitlab.root
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/gitlab.rb')
-rw-r--r-- | lib/gitlab.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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? |