Feature #27705 » support_gem_plugin.patch
| lib/redmine/plugin.rb | ||
|---|---|---|
|
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(<<EOS)
|
||
|
This plugin was installed as gem wrote to Gemfile* instead of putting Redmine's plugin directory.
|
||
|
See #{gem_name} gem installed directory.
|
||
|
EOS
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
# Keep current plugin loading method.
|
||
|
Dir.glob(File.join(self.directory, '*')).sort.each do |directory|
|
||
|
if File.directory?(directory)
|
||
|
lib = File.join(directory, "lib")
|
||