Fixed a lot of linter warnings
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-12-11 13:08:46 -05:00
parent 34741691ed
commit 516f125ea7
14 changed files with 76 additions and 34 deletions

View File

@@ -1,18 +1,20 @@
# frozen_string_literal: true
require 'yaml'
# Config - loads and manages the app's configuration
class Config
DEFAULT_CONFIG = 'config/defaults.yaml'
def initialize(config_path)
@data = YAML::load_file(DEFAULT_CONFIG)
@data = YAML.load_file(DEFAULT_CONFIG)
if File.exists?(config_path)
@data.merge!(YAML::load_file(config_path))
end
# merge in user-defined configuration if it exists
@data.merge!(YAML.load_file(config_path)) if File.exist?(config_path)
end
def get(key, depth = 0)
def get(key)
bits = key.split('.')
value = @data