class Klipbook::Config

Constants

DEFAULT_MAXBOOKS

Public Instance Methods

read() click to toggle source
# File lib/klipbook/config.rb, line 7
def read
  merge_config_from_rc_file({
    count: DEFAULT_MAXBOOKS,
    output_dir: Dir.pwd,
    force: false
  })
end

Private Instance Methods

file_config() click to toggle source
# File lib/klipbook/config.rb, line 21
def file_config
  config_file = File.expand_path("~/.klipbookrc")
  if File.exist?(config_file)
    YAML.load(File.read(config_file)) || {}
  else
    {}
  end
end
merge_config_from_rc_file(config) click to toggle source
# File lib/klipbook/config.rb, line 17
def merge_config_from_rc_file(config)
  config.merge(file_config)
end