开发者

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

开发者 https://www.devze.com 2023-01-18 12:28 出处:网络
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 t开发者_如何学

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 t开发者_如何学Gohe 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


You just need require your rake file in your Rakefile of your root project.

0

精彩评论

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