Class: Berta::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/berta/cli.rb

Overview

CLI for berta

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.safe_fetch(keys) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/berta/cli.rb', line 7

def self.safe_fetch(keys)
  current = Berta::Settings
  keys.each do |key|
    current = current[key]
    break unless current
  end
  current
end

Instance Method Details

#cleanupObject



64
65
66
67
68
# File 'lib/berta/cli.rb', line 64

def cleanup
  initialize_configuration(options)
  initialize_logger(options)
  Berta::CommandExecutor.new.cleanup
end

#versionObject



71
72
73
# File 'lib/berta/cli.rb', line 71

def version
  $stdout.puts Berta::VERSION
end