Fixed a lot of linter warnings
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user