summaryrefslogtreecommitdiffstats
path: root/config/initializers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-26 17:23:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-26 17:23:24 +0000
commit8d73ddf73ffc2cefbe16ca06970377e13d4bead0 (patch)
treeecb8fbb4d8330fe936c43127f2b921ad24eec2e8 /config/initializers
parent26868d8b140406cce8c2494efbac7f8f85f452d0 (diff)
downloadredmine-8d73ddf73ffc2cefbe16ca06970377e13d4bead0.tar.gz
redmine-8d73ddf73ffc2cefbe16ca06970377e13d4bead0.zip
Moved Rails plugins required by the core to lib/plugins.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9533 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/00-core_plugins.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/config/initializers/00-core_plugins.rb b/config/initializers/00-core_plugins.rb
new file mode 100644
index 000000000..004c2a1f6
--- /dev/null
+++ b/config/initializers/00-core_plugins.rb
@@ -0,0 +1,15 @@
+# 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 = config = RedmineApp::Application.config
+ eval(File.read(initializer), binding, initializer)
+ end
+ end
+end