简体   繁体   中英

How to move your rake tasks to the rails lib dir from in a gem generator?

Im creating a custom gem and have some rake files that need to be installed into the users /lib/tasks directory to work. I want create a generator that will move / create my rake tasks in the tasks directory so they can use them.

Does anyone have any idea how do to this in a custom gem?

Ensure that your gemspec includes the tasks

and then in your Rakefile

require 'bundler'
Bundler::GemHelper.install_tasks

您只需要在根项目的Rakefile中需要rake文件。

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