8
我有一个需要在安装宝石后执行一些rake任务的宝石。安装后使用http://blog.costan.us/2008/11/post-install-post-update-scripts-for.html中描述的方法执行代码存在一种骇人的方式。如何在红宝石宝石中使用钩子
但是Gem类现在有钩子,其中一个是post_install钩子。我试图添加一行像
Gem.post_install { puts 'post hook example' }
到Rakefile中,它似乎并没有在安装过程中执行。这条线应该放置在什么地方才能被挂钩?
check [this one](http://stackoverflow.com/questions/223151/how-can-i-write-a-hook-that-gets-called-when-a-rubygem-is-installed) – 2011-05-19 19:38:55
OP已经链接到那个帖子... – theIV 2011-05-19 19:42:07
也在寻找这个!有任何想法吗? – 2015-11-06 10:42:52