Defect #36287 ยป fix-36287.patch
| lib/redmine/plugin_loader.rb | ||
|---|---|---|
|
@plugin_directories
|
||
|
end
|
||
|
def self.mirror_assets
|
||
|
directories.each(&:mirror_assets)
|
||
|
def self.mirror_assets(name=nil)
|
||
|
if name.present?
|
||
|
directories.find{|d| d.to_s == File.join(directory, name)}.mirror_assets
|
||
|
else
|
||
|
directories.each(&:mirror_assets)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
| lib/tasks/redmine.rake | ||
|---|---|---|
|
name = ENV['NAME']
|
||
|
begin
|
||
|
Redmine::Plugin.mirror_assets(name)
|
||
|
Redmine::PluginLoader.mirror_assets(name)
|
||
|
rescue Redmine::PluginNotFound
|
||
|
abort "Plugin #{name} was not found."
|
||
|
end
|
||
| test/unit/lib/redmine/plugin_loader_test.rb | ||
|---|---|---|
|
assert File.exist?("#{@klass.public_directory}/foo_plugin/stylesheets/foo.css")
|
||
|
end
|
||
|
def test_mirror_assets
|
||
|
Redmine::PluginLoader.mirror_assets
|
||
|
assert File.exist?("#{@klass.public_directory}/foo_plugin")
|
||
|
assert File.exist?("#{@klass.public_directory}/foo_plugin/stylesheets/foo.css")
|
||
|
end
|
||
|
def test_mirror_assets_with_plugin_name
|
||
|
Redmine::PluginLoader.mirror_assets('foo_plugin')
|
||
|
assert File.exist?("#{@klass.public_directory}/foo_plugin")
|
||
|
assert File.exist?("#{@klass.public_directory}/foo_plugin/stylesheets/foo.css")
|
||
|
end
|
||
|
def clear_public
|
||
|
FileUtils.rm_rf 'tmp/public'
|
||
|
end
|
||