nicer behavior

This commit is contained in:
John Bintz 2011-08-19 13:57:11 -04:00
parent 6ec550ead7
commit 7f97c10cd3
1 changed files with 11 additions and 4 deletions

View File

@ -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