mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 06:15:59 +01:00
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@21300 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -136,8 +136,12 @@ module Redmine
|
|||||||
@plugin_directories
|
@plugin_directories
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.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)
|
directories.each(&:mirror_assets)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ DESC
|
|||||||
name = ENV['NAME']
|
name = ENV['NAME']
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Redmine::Plugin.mirror_assets(name)
|
Redmine::PluginLoader.mirror_assets(name)
|
||||||
rescue Redmine::PluginNotFound
|
rescue Redmine::PluginNotFound
|
||||||
abort "Plugin #{name} was not found."
|
abort "Plugin #{name} was not found."
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -41,6 +41,20 @@ class Redmine::PluginLoaderTest < ActiveSupport::TestCase
|
|||||||
assert File.exist?("#{@klass.public_directory}/foo_plugin/stylesheets/foo.css")
|
assert File.exist?("#{@klass.public_directory}/foo_plugin/stylesheets/foo.css")
|
||||||
end
|
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
|
def clear_public
|
||||||
FileUtils.rm_rf 'tmp/public'
|
FileUtils.rm_rf 'tmp/public'
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user