From 7f8ca7da39df27ea627e3eecb8c65d39d7ed81c7 Mon Sep 17 00:00:00 2001 From: David Dollar Date: Tue, 8 Mar 2011 12:14:48 -0500 Subject: [PATCH] support .foreman file for default options --- lib/foreman/cli.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/foreman/cli.rb b/lib/foreman/cli.rb index 6d7872b..8c5ccdc 100644 --- a/lib/foreman/cli.rb +++ b/lib/foreman/cli.rb @@ -70,8 +70,6 @@ private ###################################################################### options[:procfile] || "Procfile" end -private ###################################################################### - def display(message) puts message end @@ -85,4 +83,11 @@ private ###################################################################### File.exist?(procfile) end + def options + original_options = super + return original_options unless File.exists?(".foreman") + defaults = YAML::load_file(".foreman") + Thor::CoreExt::HashWithIndifferentAccess.new(defaults.merge(original_options)) + end + end