Class: DepsGrapher::Cli

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/deps_grapher/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logging

#error, #info, #verbose, #warn

Constructor Details

#initialize(command) ⇒ Cli

Returns a new instance of Cli.



17
18
19
# File 'lib/deps_grapher/cli.rb', line 17

def initialize(command)
  @command = command
end

Class Method Details

.run!(command) ⇒ Object



12
13
14
# File 'lib/deps_grapher/cli.rb', line 12

def run!(command)
  new(command).run!
end

Instance Method Details

#run!Object



21
22
23
24
25
26
27
# File 'lib/deps_grapher/cli.rb', line 21

def run!
  @command.run!
  STATUS_SUCCESS
rescue StandardError => e
  error { e.backtrace.unshift(e.message).join("\n") }
  STATUS_FAILURE
end