Class: Salus::CLI

Inherits:
Thor
  • Object
show all
Includes:
BaseCliUtils, Thor::Actions
Defined in:
lib/salus/cli.rb

Constant Summary

Constants included from BaseCliUtils

BaseCliUtils::SALUS_FILE, BaseCliUtils::SALUS_GLOB, BaseCliUtils::SALUS_STATE_FILE

Instance Method Summary collapse

Methods included from BaseCliUtils

#get_files, #get_state_file, #load_files, #load_state, #read_file, #save_state, #write_file

Methods included from Logging

#log

Instance Method Details

#loopObject



32
33
34
35
36
37
# File 'lib/salus/cli.rb', line 32

def loop
  Salus.logger.level = options[:debug] ? Logger::DEBUG : Logger::WARN
  load_files(get_files(options))
  append_renderers(options)
  Salus.run
end

#onceObject



18
19
20
21
22
23
24
25
26
# File 'lib/salus/cli.rb', line 18

def once
  Salus.logger.level = options[:debug] ? Logger::DEBUG : Logger::WARN
  load_files(get_files(options))
  state_file = get_state_file(options)
  load_state(state_file)
  append_renderers(options)
  Salus.tick
  save_state(state_file)
end