module Evesync::Config

Constants

DEFAULTS

Public Class Methods

[](param) click to toggle source
# File lib/evesync/config.rb, line 34
def [](param)
  config[param.to_s]
end
reread() click to toggle source
# File lib/evesync/config.rb, line 38
def reread
  read_config
end

Private Class Methods

config() click to toggle source
# File lib/evesync/config.rb, line 57
def config
  read_config if ! defined? @@config
  @@config
end
read_config() click to toggle source
# File lib/evesync/config.rb, line 44
def read_config
  config = begin
             TomlRB.load_file(Constants::CONFIG_FILE)
           rescue StandardError => e
             Log.error("Config ERROR: Couldn't parse file #{Constants::CONFIG_FILE}")
             Log.error("Config ERROR MESSAGE: #{e}")
             Log.error("Config ERROR: Using default configuration")
             {}
           end
  @@config = DEFAULTS.deep_merge(config)
  Log.info("Config initialized!")
end