Using the tool for a complex command line tool

I want to create a command line tool in Ruby using Thor. This tool should be packaged like a gem so that it is easily installed and removed.

Creating and publishing the gem I did. I also created some Thor scripts that also work. However, I do not know how to combine them.

My goal is to call my tool like this: Mytool task parameters mytool taskgroup: task param --options

I know how to make one Thor script executable. However, how can I make a bunch of accurate scripts available with a single command?

+4
source share
1 answer

According to the relevant Gem documentation , you can specify (in your .gemspec):

spec.executables = ['bin/foo', 'bin/bar'] spec.default_executable = 'bin/bar' 

and your pearl will install a bunch of executable files ( foo and bar ). Or you write a wrapper for all your Thor scripts and specify:

 spec.executables = ['bin/wrapper'] 

and your pearl will install only one executable file ( wrapper ).

+1
source

All Articles