diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 7f058a31d..f95c17fa5 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -143,6 +143,28 @@ module Redmine #:nodoc: end def self.load + # load plugins from bundle installed gems. + Gem.loaded_specs.each do |gem_name, gem_spec| + initializer = File.join(gem_spec.full_gem_path, 'init.rb') + is_redmine_plugin = true # TODO: detect redmine plugin + if File.file?(initializer) && is_redmine_plugin + # TODO: Set plugin.directory to gem root. + require initializer + + # Make pointer to reduce confusing for redmine maintainer + path = File.join(Redmine::Plugin.directory, gem_name) + if !File.exists?(path) + File.open(path, 'w') do |f| + f.write(<