Added Sequel ORM for database handling; added navbar

This commit is contained in:
2023-07-05 18:04:31 -04:00
parent 6f680e72e5
commit 6c1c8bca0a
16 changed files with 122 additions and 4 deletions

26
src/config.rb Normal file
View File

@@ -0,0 +1,26 @@
require 'yaml'
class Config
DEFAULT_CONFIG = 'config/defaults.yaml'
def initialize(config_path)
@data = YAML::load_file(DEFAULT_CONFIG)
if File.exists?(config_path)
@data.merge!(YAML::load_file(config_path))
end
end
def get(key, depth = 0)
bits = key.split('.')
value = @data
bits.each do |bit|
value = value[bit]
end
return value
end
end