class EacRubyUtils::Configs

def [](entry_key)

def [](entry_key)
  read_entry(entry_key)
end

def []=(entry_key, entry_value)

def []=(entry_key, entry_value)
  write_entry(entry_key, entry_value)
end

def default_storage_path

def default_storage_path
  ::File.join(ENV['HOME'], '.config', configs_key, 'settings.yml')
end

def file_uncached

def file_uncached
  ::EacRubyUtils::Configs::File.new(
    storage_path, options
  )
end

def initialize(configs_key, options = {})

Valid options: [:storage_path]
def initialize(configs_key, options = {})
  @configs_key = configs_key
  @options = options.to_sym_keys_hash.freeze
  load
end

def options_storage_path

def options_storage_path
  options[:storage_path]
end

def read_entry(entry_key)

def read_entry(entry_key)
  file.read(entry_key)
end

def storage_path_uncached

def storage_path_uncached
  path = options_storage_path || default_storage_path
  return path if ::File.exist?(path) && ::File.size(path).positive?
  ::FileUtils.mkdir_p(::File.dirname(path))
  ::File.write(path, {}.to_yaml)
  path
end

def write_entry(entry_key, entry_value)

def write_entry(entry_key, entry_value)
  file.write(entry_key, entry_value)
end