diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-05-01 10:25:22 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-05-01 10:25:22 +0000 |
commit | b097a1753e673ee77393d28c7fd50c21e847378c (patch) | |
tree | 285c2520efda3549f015d506f6de6ca049d1a59c /lib | |
parent | f54ecfc55f78f320018514cca7e07eceb896c69d (diff) | |
download | redmine-b097a1753e673ee77393d28c7fd50c21e847378c.tar.gz redmine-b097a1753e673ee77393d28c7fd50c21e847378c.zip |
Let redmine:plugins:assets mirror a single plugin assets with name=.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9599 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/plugin.rb | 12 | ||||
-rw-r--r-- | lib/tasks/redmine.rake | 8 |
2 files changed, 15 insertions, 5 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 24f921f53..faa48f46a 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -359,10 +359,14 @@ module Redmine #:nodoc: end end - # Mirrors all plugins' assets to public/plugin_assets - def self.mirror_assets - all.each do |plugin| - plugin.mirror_assets + # Mirrors assets from one or all plugins to public/plugin_assets + def self.mirror_assets(name=nil) + if name.present? + find(name).mirror_assets + else + all.each do |plugin| + plugin.mirror_assets + end end end diff --git a/lib/tasks/redmine.rake b/lib/tasks/redmine.rake index a75483af2..90e642588 100644 --- a/lib/tasks/redmine.rake +++ b/lib/tasks/redmine.rake @@ -74,7 +74,13 @@ namespace :redmine do desc 'Copies plugins assets into the public directory.' task :assets => :environment do - Redmine::Plugin.mirror_assets + name = ENV['name'] + + begin + Redmine::Plugin.mirror_assets(name) + rescue Redmine::PluginNotFound + abort "Plugin #{name} was not found." + end end end end |