summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-11-17 20:52:59 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-11-17 20:52:59 +0000
commite82b0a77e348419bb4c4ed736ac126e22358eac0 (patch)
tree8eea2c3d0694810ff5a199685616a9ece2fc936f
parent0352ab71cf89950f81e29f034529ce16b5bd9105 (diff)
downloadredmine-e82b0a77e348419bb4c4ed736ac126e22358eac0.tar.gz
redmine-e82b0a77e348419bb4c4ed736ac126e22358eac0.zip
Load core plugins using require (#29914, #32938).
Patch by Takashi Kato. git-svn-id: http://svn.redmine.org/redmine/trunk@21286 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--config/initializers/00-core_plugins.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/config/initializers/00-core_plugins.rb b/config/initializers/00-core_plugins.rb
index 3bcd00be6..e20599000 100644
--- a/config/initializers/00-core_plugins.rb
+++ b/config/initializers/00-core_plugins.rb
@@ -1,17 +1,12 @@
# frozen_string_literal: true
# Loads the core plugins located in lib/plugins
-Dir.glob(File.join(Rails.root, "lib/plugins/*")).sort.each do |directory|
- if File.directory?(directory)
- lib = File.join(directory, "lib")
- if File.directory?(lib)
- $:.unshift lib
- ActiveSupport::Dependencies.autoload_paths += [lib]
- end
- initializer = File.join(directory, "init.rb")
- if File.file?(initializer)
- config = RedmineApp::Application.config
- eval(File.read(initializer), binding, initializer)
- end
+Dir.glob(Rails.root.join('lib/plugins/*')).sort.each do |directory|
+ next unless File.directory?(directory)
+
+ initializer = File.join(directory, 'init.rb')
+ if File.file?(initializer)
+ config = RedmineApp::Application.config
+ eval(File.read(initializer), binding, initializer)
end
end