diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-06-01 02:43:47 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-06-01 13:46:46 +0800 |
commit | 39b6f31c66ff51451033ff84a2832731065cd28d (patch) | |
tree | 0554167eb4e6133390e77016139bfe5c8b39ba3b /config | |
parent | db40a7c4e359052313b9a7bf104aa4e9586deada (diff) | |
download | gitlab-ce-39b6f31c66ff51451033ff84a2832731065cd28d.tar.gz |
Eliminate constants warnings by:
* Replace `require` or `require_relative` with `require_dependency`
* Remove unneeded `autoload`
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/2_gitlab.rb | 2 | ||||
-rw-r--r-- | config/initializers/omniauth.rb | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/config/initializers/2_gitlab.rb b/config/initializers/2_gitlab.rb index 1d2ab606a63..8b7f245b7b0 100644 --- a/config/initializers/2_gitlab.rb +++ b/config/initializers/2_gitlab.rb @@ -1 +1 @@ -require_relative '../../lib/gitlab' +require_dependency 'gitlab' diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index e33ebb25c4c..a93a43d88ee 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -20,11 +20,10 @@ end if Gitlab.config.omniauth.enabled provider_names = Gitlab.config.omniauth.providers.map(&:name) require 'omniauth-kerberos' if provider_names.include?('kerberos') -end -module OmniAuth - module Strategies - autoload :Bitbucket, Rails.root.join('lib', 'omni_auth', 'strategies', 'bitbucket') - autoload :Jwt, Rails.root.join('lib', 'omni_auth', 'strategies', 'jwt') + Gitlab::Auth.omniauth_providers.each do |provider| + if provider_names.include?(provider) + require_dependency "omni_auth/strategies/#{provider}" + end end end |