module FIR::Config

Constants

API_YML_PATH
APP_FILE_TYPE
APP_INFO_PATH
CONFIG_PATH

Public Instance Methods

bughd_api() click to toggle source
# File lib/fir/util/config.rb, line 14
def bughd_api
  @bughd_api ||= YAML.load_file(API_YML_PATH).deep_symbolize_keys[:bughd]
end
config() click to toggle source
# File lib/fir/util/config.rb, line 18
def config
  return unless File.exist?(CONFIG_PATH)
  @config ||= YAML.load_file(CONFIG_PATH).deep_symbolize_keys
end
current_token() click to toggle source
# File lib/fir/util/config.rb, line 35
def current_token
  @token ||= config[:token] if config
end
fir_api() click to toggle source
# File lib/fir/util/config.rb, line 10
def fir_api
  @fir_api ||= YAML.load_file(API_YML_PATH).deep_symbolize_keys[:fir]
end
reload_config() click to toggle source
# File lib/fir/util/config.rb, line 23
def reload_config
  @config = YAML.load_file(CONFIG_PATH).deep_symbolize_keys
end
write_app_info(hash) click to toggle source
# File lib/fir/util/config.rb, line 31
def write_app_info(hash)
  File.open(APP_INFO_PATH, 'w+') { |f| f << YAML.dump(hash) }
end
write_config(hash) click to toggle source
# File lib/fir/util/config.rb, line 27
def write_config(hash)
  File.open(CONFIG_PATH, 'w+') { |f| f << YAML.dump(hash) }
end