Skip to content

Instantly share code, notes, and snippets.

@joemsak
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemsak/552f5bbf9b641c3da4c5 to your computer and use it in GitHub Desktop.
Save joemsak/552f5bbf9b641c3da4c5 to your computer and use it in GitHub Desktop.
def config
conf = default_config
path = 'config/writer.yml'
if File.exist?(path)
config_file = File.open(path)
user_config = YAML.load(config_file)
conf = conf.merge(user_config)
end
conf
end
def default_config
{
namer: 'Writer::FileNamer',
creator: 'Writer::FileCreator',
logger: 'Writer::Logger',
date_format: '%Y-%m%b-%d',
log_level: 2, # see Logger for levels
template_path: ''
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment