diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-05-01 09:02:34 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-05-01 09:02:34 +0000 |
commit | 45093230a9c6328751a5604983239f6684e7bec7 (patch) | |
tree | 8e8a40bcff14beaad0b8cdbcac83c5260e874c47 /lib/tasks/redmine.rake | |
parent | f4b9d2a7ee48945ff948b69c4d7481139b076209 (diff) | |
download | redmine-45093230a9c6328751a5604983239f6684e7bec7.tar.gz redmine-45093230a9c6328751a5604983239f6684e7bec7.zip |
Adds deprecated tasks for plugins migration.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9597 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks/redmine.rake')
-rw-r--r-- | lib/tasks/redmine.rake | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/tasks/redmine.rake b/lib/tasks/redmine.rake index 2359c827a..a75483af2 100644 --- a/lib/tasks/redmine.rake +++ b/lib/tasks/redmine.rake @@ -51,9 +51,24 @@ namespace :redmine do namespace :plugins do desc 'Migrates installed plugins.' task :migrate => :environment do - Redmine::Plugin.all.each do |plugin| - puts "Migrating #{plugin.name}..." - plugin.migrate + name = ENV['name'] + version = nil + version_string = ENV['version'] + if version_string + if version_string =~ /^\d+$/ + version = version_string.to_i + if name.nil? + abort "The VERSION argument requires a plugin NAME." + end + else + abort "Invalid version #{version_string} given." + end + end + + begin + Redmine::Plugin.migrate(name, version) + rescue Redmine::PluginNotFound + abort "Plugin #{name} was not found." end end |