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