From 7f97c10cd35429788a266699eb35b93dfdfed010 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 19 Aug 2011 13:57:11 -0400 Subject: [PATCH] nicer behavior --- bin/penchant | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/penchant b/bin/penchant index c360f64..e3553d2 100755 --- a/bin/penchant +++ b/bin/penchant @@ -24,15 +24,22 @@ class PenchantCLI < Thor gemfile(:remote) end - desc "gemfile ENV", "Switch the gemfile environment" - def gemfile(env) + desc "gemfile ENV", "Switch the gemfile environment, or rebuild the current environment if not given" + def gemfile(env = get_current_env) + puts "[penchant] Rebunding for #{env} environment..." Penchant::Gemfile.do_full_env_switch!(env) end desc "gemfile-env", "Get the gemfile environment" def gemfile_env - gemfile = Penchant::Gemfile.new - puts gemfile.environment + puts get_current_end + end + + no_tasks do + def get_current_env + gemfile = Penchant::Gemfile.new + gemfile.environment + end end end