Class: Meroku::CLI

Inherits:
Object
  • Object
show all
Includes:
Api, Shared
Defined in:
lib/meroku/cli.rb

Overview

The CLI is a class responsible of handling all the command line interface logic.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api

#post

Methods included from Shared

ec2_client

Constructor Details

#initializeCLI

Returns a new instance of CLI.



11
12
13
# File 'lib/meroku/cli.rb', line 11

def initialize
  @options = {}
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/meroku/cli.rb', line 9

def options
  @options
end

Instance Method Details

#run(args = ARGV) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/meroku/cli.rb', line 15

def run(args = ARGV)
  @options = Options.new.parse(args)
  act_on_options
rescue Meroku::Error => e
  puts "Error: #{e.message}"
  return 2
end