Complete the Thor task in the associated jewel

I have a my_gem gem that has thor as a runtime dependency. I have a subclass of Thor located in stone:

lib/tasks/task.thor

from the gemstone source directory that I can run:

 bundle thor task:my_task 

and my_task will be executed.

However, if I include my_gem in the Gemfile for another project, when I run:

 bundle thor task:my_task 

I get:

No exact tasks available

what am I doing wrong?

+4
source share
1 answer

It seems to me that if I understand correctly that your lib / tasks / task.thor is actually part of the gem itself, and you expect it to find your exact file buried in your gem.

If so, this will not work, as the author will not automatically search for gems in your catalogs.

You might want to consider not using torus files at all and just write a command that uses the command to process command line parameters, such as Rails.

If you really need to run the torus this way, then your gem should do the β€œmagic” to put your torus files in the search path.

0
source

All Articles