The executable file

I create a folder bin and create inside of this folder an executable file called in this case as the gem, ‘artify’.

When I type: $ruby bin/artify,  everything run but I don’t want this. I want that the user from the bash can type: $ ./bin/artify.

So I type:

$ cd bin/

$ ls -lah

Ad I can see that artify doesn’t have executable permissions. To change this I type:

$ chmod +x artify

$ ls -lah

This executable file is not a ruby file so I have to include at the top the following:

#!/usr/bin/env ruby

Then I require our environment file to use all the gems already installed.

In this file I want to run for my still imaginary CLI class. I want to write here something like: CLI.new.run.

So, at this point, I know I want a class CLI, where I am going to build all the methods and keep all data to run my CLI.

I finally changed this name for ‘artify’ in case I want to publish it in RubyGems.org.

Leave a Reply

Your email address will not be published.