How to move your rake tasks to the rails lib dir f

2019-07-06 01:02发布

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?

2条回答
够拽才男人
2楼-- · 2019-07-06 01:38

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

查看更多
\"骚年 ilove
3楼-- · 2019-07-06 01:52

Ensure that your gemspec includes the tasks

and then in your Rakefile

require 'bundler'
Bundler::GemHelper.install_tasks
查看更多
登录 后发表回答