diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-06-03 22:26:44 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-06-03 22:26:44 +0000 |
commit | 59432fe89b6f8e5352cb845256b265cf5718d27b (patch) | |
tree | 3b0dc86d81014f7c11f35f275cca98aeeb697eaf /railties/lib/commands | |
parent | 68e35f13719934adc8b15e8108cb607ace50197f (diff) | |
download | rails-59432fe89b6f8e5352cb845256b265cf5718d27b.tar.gz rails-59432fe89b6f8e5352cb845256b265cf5718d27b.tar.bz2 rails-59432fe89b6f8e5352cb845256b265cf5718d27b.zip |
Added uninstall.rb hook to plugin handling, such that plugins have a way of removing assets and other artifacts on removal (closes #5003) [takiuchi@drecom.co.jp]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4427 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/commands')
-rw-r--r-- | railties/lib/commands/plugin.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/lib/commands/plugin.rb b/railties/lib/commands/plugin.rb index 946e947f70..f18a49d683 100644 --- a/railties/lib/commands/plugin.rb +++ b/railties/lib/commands/plugin.rb @@ -185,6 +185,7 @@ class Plugin path = "#{rails_env.root}/vendor/plugins/#{name}" if File.directory?(path) puts "Removing 'vendor/plugins/#{name}'" if $verbose + run_uninstall_hook rm_r path else puts "Plugin doesn't exist: #{path}" @@ -216,6 +217,11 @@ class Plugin load install_hook_file if File.exists? install_hook_file end + def run_uninstall_hook + uninstall_hook_file = "#{rails_env.root}/vendor/plugins/#{name}/uninstall.rb" + load uninstall_hook_file if File.exists? uninstall_hook_file + end + def install_using_export(options = {}) svn_command :export, options end |