Module: Mihari::Configurable

Included in:
Analyzers::Base, Emitters::Base
Defined in:
lib/mihari/configurable.rb

Instance Method Summary collapse

Instance Method Details

#config_keysObject



18
19
20
# File 'lib/mihari/configurable.rb', line 18

def config_keys
  []
end

#configuration_statusObject



9
10
11
12
13
14
15
16
# File 'lib/mihari/configurable.rb', line 9

def configuration_status
  return nil if config_keys.empty?

  names = config_keys.join(" and ")
  be_verb = config_keys.length == 1 ? "is" : "are"
  status = configured? ? "found" : "missing"
  "#{names} #{be_verb} #{status}"
end

#configured?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/mihari/configurable.rb', line 5

def configured?
  config_keys.all? { |key| ENV.key? key }
end