Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 730 Bytes

ruby.md

File metadata and controls

28 lines (19 loc) · 730 Bytes

Command line application template for Ruby

Implement CLI application by editing main.rb.
You may add new files to keep your code clean, if it is allowed in your challenge.

How to get input parameters

In main.rb, there is a function called main, which gives command line arguments as argv.

def main(argv)
  # code to run
end

argv passed here is came from index.rb which passes ARGV to main function.

How to output result

Use the standard puts method to output results to stdout.

puts "Hello World"

Install External Libraries

If you want to use external libraries, do the following:

  • Write the library name in Gemfile