From 380129984794b824af14492e19e7c81a73afaa90 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 31 Aug 2011 21:39:50 -0400 Subject: [PATCH] change how dotfiles are handled --- bin/penchant | 2 +- lib/penchant/gemfile.rb | 4 ++-- spec/lib/penchant/gemfile_spec.rb | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/penchant b/bin/penchant index 309735f..e8879c1 100755 --- a/bin/penchant +++ b/bin/penchant @@ -28,7 +28,7 @@ class PenchantCLI < Thor def gemfile(env = get_current_env) if env puts "[penchant] Rebunding for #{env} environment..." - !Penchant::Gemfile.do_full_env_switch!(env) + Penchant::Gemfile.do_full_env_switch!(env) end gemfile = Penchant::Gemfile.new diff --git a/lib/penchant/gemfile.rb b/lib/penchant/gemfile.rb index 1ddd347..b84cc26 100644 --- a/lib/penchant/gemfile.rb +++ b/lib/penchant/gemfile.rb @@ -7,6 +7,8 @@ module Penchant class << self def do_full_env_switch!(env) gemfile = Penchant::Gemfile.new + run_dot_penchant!(gemfile_env) if has_dot_penchant? + if !gemfile.has_gemfile_erb? return false end @@ -52,8 +54,6 @@ module Penchant fh.print ERB.new(template).result(binding) end - - run_dot_penchant!(gemfile_env) if has_dot_penchant? end private diff --git a/spec/lib/penchant/gemfile_spec.rb b/spec/lib/penchant/gemfile_spec.rb index 356581e..6b4d27b 100644 --- a/spec/lib/penchant/gemfile_spec.rb +++ b/spec/lib/penchant/gemfile_spec.rb @@ -114,8 +114,6 @@ ERB it { should have_dot_penchant } it 'should process the file' do - subject.expects(:run_dot_penchant!).with(:not) - subject.switch_to!(:not) end end