Skip to content

Instantly share code, notes, and snippets.

@ZachMassia
Created May 7, 2013 19:08
Show Gist options
  • Save ZachMassia/5535235 to your computer and use it in GitHub Desktop.
Save ZachMassia/5535235 to your computer and use it in GitHub Desktop.
CONFIG_FILE = File.expand_path_relative_to_caller('../hatterrc')
def initialize(config_file = CONFIG_FILE)
reader = ConfigToolkit::KeyValueReader.new user_config || config_file
load reader
end
def user_config
path = File.join(Dir.home, '.hatterrc')
File.exists?(path) ? path : nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment