class Dbdoc::Config

Dbdoc::Config class knows how to load the default config from the dbdoc gem folder. Later, if needed, this class could be used to merge user-defined config with the default one.

Public Class Methods

new(local_path: Dir.pwd) click to toggle source
# File lib/dbdoc/config.rb, line 11
def initialize(local_path: Dir.pwd)
  @local_path = local_path
end

Public Instance Methods

load() click to toggle source
# File lib/dbdoc/config.rb, line 15
def load
  local_config_file = File.join(@local_path, "config.yml")

  if File.exist?(local_config_file)
    YAML.load(File.read(local_config_file))
  else
    {}
  end
end