简体   繁体   中英

convert rails plugin with rake tasks and capistrano recipes into gem

I want to convert rails plugin into gem.

Is there any way to make gem to auto add rake tasks 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM