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:
authorYorick Peterse <yorickpeterse@gmail.com>2019-06-13 15:18:01 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2019-06-20 15:51:49 +0300
commit0e41564762cd74c6cbf938dcc319c3b77a891dc7 (patch)
tree1a1a67a7eb29e4e42de345fbd70a86c6dcd35477 /lib/gitlab.rb
parent3cd038e3046a18e38e25d7904cca9e38ea6565dd (diff)
Backport gitlab.yml.example from EE
To make this happen, we need to conditionally add the group_saml strategy when running tests, but only on EE. This requires some changes to Gitlab.ee? so that it can be used before/without loading the Rails environment. We also have to change how we require a few files, so this can run outside of Rails.
Diffstat (limited to 'lib/gitlab.rb')
-rw-r--r--lib/gitlab.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb
index ccaf06c5d6a..fd4bbd69468 100644
--- a/lib/gitlab.rb
+++ b/lib/gitlab.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_dependency 'gitlab/popen'
+require_dependency File.expand_path('gitlab/popen', __dir__)
module Gitlab
def self.root
@@ -60,11 +60,15 @@ module Gitlab
end
def self.ee?
- if ENV['IS_GITLAB_EE'].present?
- Gitlab::Utils.to_boolean(ENV['IS_GITLAB_EE'])
- else
- Object.const_defined?(:License)
- end
+ @is_ee ||=
+ if ENV['IS_GITLAB_EE'].present?
+ Gitlab::Utils.to_boolean(ENV['IS_GITLAB_EE'])
+ else
+ # We may use this method when the Rails environment is not loaded. This
+ # means that checking the presence of the License class could result in
+ # this method returning `false`, even for an EE installation.
+ root.join('ee/app/models/license.rb').exist?
+ end
end
def self.http_proxy_env?