post-install hook for a particular gem
- by Henry Flower
Here is what I've googled:
http://www.mail-archive.com/[email protected]/msg02168.html
Gem.post_install do |installer|
puts "!!! #{installer.spec.full_name} INSTALLED !!!"
end
But where to put this snipped? If I put it in my Rakefile and/or src_of_myproject/lib/rubygems_plugin.rb file, than build the gem, install it--but the expected string is never printed after the installation.
I'm totally confused. How to embed the post-install hook into the gem spec?
Update: it's getting more interesting. If I put Gem.post_uninstall hook in src_of_myproject/lib/rubygems_plugin.rb--that hook works.
Gem.post_uninstall do |uninstaller|
puts "!!! #{uninstaller.spec.full_name} UNINSTALLED !!!"
end
Hm... And wtf is with Gem.post_install?