Project

General

Profile

Patch #2265 » migrate_plugins.diff

Jean-Baptiste Barth, 2008-12-02 22:47

View differences:

lib/tasks/migrate_plugins.rake (working copy)
puts "Make sure engines plugin is installed."
end
end
desc 'Migrate a specified plugin.'
task :migrate_plugin => :environment do
if ENV['NAME'].blank?
puts "Please give a plugin name with NAME=my_plugin"
exit
end
name = ENV['NAME']
version = ENV['VERSION']
if plugin = Rails.plugins[name]
puts "Migrating #{plugin.name} to " + (version ? "version #{version}" : 'latest version') + "..."
plugin.migrate(version ? version.to_i : nil)
else
puts "Plugin #{name} does not exist."
end
end
end
(1-1/2)