Module: Mixin::DefaultConfig

Includes:
ConfigChoice
Defined in:
lib/clearbooks/interface/thor/mixin/default_config.rb

Instance Method Summary collapse

Methods included from ConfigChoice

#config_choice

Instance Method Details

#defaultsObject



17
18
19
20
21
22
23
24
25
# File 'lib/clearbooks/interface/thor/mixin/default_config.rb', line 17

def defaults
  config_path = File.expand_path( '~/.clearbooks/config.yml' )
  if File.exists?(config_path)
    YAML.load_file(config_path)
  else
    FileUtils.mkdir_p( File.expand_path( '~/.clearbooks' ) )
    config_choice
  end
end