From 575302c1b94984cc8e96e71b8ab606e69283ec67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Tue, 24 Apr 2018 16:43:41 +0200 Subject: [PATCH] Do not preload settings --- config/initializers/1_settings.rb | 2 +- config/initializers/2_gitlab.rb | 1 + {lib => config}/settings.rb | 0 lib/gitlab.rb | 1 - spec/fast_spec_helper.rb | 3 ++- 5 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 config/initializers/2_gitlab.rb rename {lib => config}/settings.rb (100%) diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 9b00ae459a3..575f27d1ea9 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -1,4 +1,4 @@ -require_dependency File.expand_path('../../lib/gitlab', __dir__) # Load Gitlab as soon as possible +require_relative '../settings' # Default settings Settings['ldap'] ||= Settingslogic.new({}) diff --git a/config/initializers/2_gitlab.rb b/config/initializers/2_gitlab.rb new file mode 100644 index 00000000000..1d2ab606a63 --- /dev/null +++ b/config/initializers/2_gitlab.rb @@ -0,0 +1 @@ +require_relative '../../lib/gitlab' diff --git a/lib/settings.rb b/config/settings.rb similarity index 100% rename from lib/settings.rb rename to config/settings.rb diff --git a/lib/gitlab.rb b/lib/gitlab.rb index 0a167104bf4..9c9368a4f8d 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -1,4 +1,3 @@ -require_dependency 'settings' require_dependency 'gitlab/popen' module Gitlab diff --git a/spec/fast_spec_helper.rb b/spec/fast_spec_helper.rb index f28268b0754..978113a08a4 100644 --- a/spec/fast_spec_helper.rb +++ b/spec/fast_spec_helper.rb @@ -9,7 +9,8 @@ unless Object.respond_to?(:require_dependency) end end -# Defines Gitlab and Gitlab.config which are at the center of the app +# Defines Settings and Gitlab.config which are at the center of the app +require_relative '../config/settings' require_relative '../lib/gitlab' unless defined?(Gitlab.config) require_relative 'support/rspec'