Create command line application with Ruby available via Homebrew
05-Nov-2020 1289
The goal of this article is to show you how you can create your command line application using the Ruby programming language and make it available.Our goal is to build a get_joke application that will render a random joke about Chuck Norris. The command will also be able to parse the following arguments:random - random jokes that should be displayed. By default, one joke is shown, but if you are prepared to read more, you can pass the -r or --random argument with the number of jokes you would like to seefirst_name - the first name you would like to see instead of Chuck. It should be possible to pass the custom first name with -f or --first-name argumentlast_name - the last name you would like to see instead of Norris. It should be possible to pass the custom last name with -l or --last-name argumenthelp - the help command that displays the list of available commands along with the short description. The command is rendered when the -h or --help argument is passed. The command should not display the joke when this argument is passed.As the data source, we will use the http://api.icndb.com/jokes/random endpoint, which provides a nice and simple API for getting jokes about Chuck.
Create command line application with Ruby available via Homebrew #ruby #rubydeveloper #rubyonrails #Create #command #application #available #Homebrew #application https://rubyonrails.ba/link/create-command-line-application-with-ruby-available-via-homebrew