Commit c5e34da0 authored by Rémy Coutable's avatar Rémy Coutable

Remove explicit `require` calls, and use `require_dependency` when needed

See
http://guides.rubyonrails.org/autoloading_and_reloading_constants.html
for more info.
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 32da7602
require 'project_wiki'
class Projects::WikisController < Projects::ApplicationController class Projects::WikisController < Projects::ApplicationController
before_action :authorize_read_wiki! before_action :authorize_read_wiki!
before_action :authorize_create_wiki!, only: [:edit, :create, :history] before_action :authorize_create_wiki!, only: [:edit, :create, :history]
......
...@@ -120,9 +120,9 @@ if Gitlab::Metrics.enabled? ...@@ -120,9 +120,9 @@ if Gitlab::Metrics.enabled?
# These are manually require'd so the classes are registered properly with # These are manually require'd so the classes are registered properly with
# ActiveSupport. # ActiveSupport.
require 'gitlab/metrics/subscribers/action_view' require_dependency 'gitlab/metrics/subscribers/action_view'
require 'gitlab/metrics/subscribers/active_record' require_dependency 'gitlab/metrics/subscribers/active_record'
require 'gitlab/metrics/subscribers/rails_cache' require_dependency 'gitlab/metrics/subscribers/rails_cache'
Gitlab::Application.configure do |config| Gitlab::Application.configure do |config|
config.middleware.use(Gitlab::Metrics::RackMiddleware) config.middleware.use(Gitlab::Metrics::RackMiddleware)
......
...@@ -20,15 +20,12 @@ OmniAuth.config.before_request_phase do |env| ...@@ -20,15 +20,12 @@ OmniAuth.config.before_request_phase do |env|
end end
if Gitlab.config.omniauth.enabled if Gitlab.config.omniauth.enabled
Gitlab.config.omniauth.providers.each do |provider| provider_names = Gitlab.config.omniauth.providers.map(&:name)
if provider['name'] == 'kerberos' require 'omniauth-kerberos' if provider_names.include?('kerberos')
require 'omniauth-kerberos'
end
end
end end
module OmniAuth module OmniAuth
module Strategies module Strategies
autoload :Bitbucket, Rails.root.join('lib', 'omniauth', 'strategies', 'bitbucket') autoload :Bitbucket, Rails.root.join('lib', 'omni_auth', 'strategies', 'bitbucket')
end end
end end
require 'gitlab/o_auth/user'
# LDAP extension for User model # LDAP extension for User model
# #
# * Find or create user from omniauth.auth data # * Find or create user from omniauth.auth data
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment