Class: Fixversion::CLI::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/fixversion/cli/shell.rb

Overview

The main Command Line Interface (CLI) object.

Instance Method Summary collapse

Constructor Details

#initialize(parser: Parser.new, **dependencies) ⇒ Shell

Returns a new instance of Shell.



9
10
11
12
# File 'lib/fixversion/cli/shell.rb', line 9

def initialize parser: Parser.new, **dependencies
  super(**dependencies)
  @parser = parser
end

Instance Method Details

#call(arguments = []) ⇒ Object



14
15
16
17
18
# File 'lib/fixversion/cli/shell.rb', line 14

def call arguments = []
  perform parser.call(arguments)
rescue OptionParser::ParseError => error
  logger.error { error.message }
end