开发者

convert rails plugin with rake tasks and capistrano recipes into gem

开发者 https://www.devze.com 2022-12-17 21:03 出处:网络
I want to convert rails plugin into gem. Is there any way to make gem to auto add rake tas开发者_C百科ks and capistrano recipes when mentioned in environment.rb using config.gem command?As tadman sai

I want to convert rails plugin into gem.

Is there any way to make gem to auto add rake tas开发者_C百科ks and capistrano recipes when mentioned in environment.rb using config.gem command?


As tadman said, you cannot do it. However, you can either install a plugin or ask the user to require your tasks in the Rakefile, as collectiveidea-delayed_job does.


As far as I know, a gem cannot define tasks or capistrano recipes directly, but may be used within tasks and recipes.

If you need something that is a gem and still has rake tasks and recipes, you may want to look at the approach used by HAML. When you install the gem, you still need to install a plug-in, even though the "plugin" is simply a hook to load the gem.

0

精彩评论

暂无评论...
验证码 换一张
取 消