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



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

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



79
80
81
82
83
84
# File 'lib/berta/cli.rb', line 79

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

#configObject



92
93
94
95
# File 'lib/berta/cli.rb', line 92

def config
  initialize_configuration(options)
  Berta::Settings.each { |key, val| $stdout.puts "#{key}\t=\t#{val}" }
end

#versionObject



87
88
89
# File 'lib/berta/cli.rb', line 87

def version
  $stdout.puts Berta::VERSION
end