Skip to content

Commit

Permalink
check and only install if necessary -> faster
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Oct 20, 2012
1 parent ec22939 commit ec1caf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/appraisal/appraisal.rb
Expand Up @@ -37,7 +37,8 @@ def gemfile_path
end

def bundle_command
"bundle install --gemfile='#{gemfile_path}'"
gemfile = "--gemfile='#{gemfile_path}'"
"bundle check #{gemfile} || bundle install #{gemfile}"
end

private
Expand Down
2 changes: 1 addition & 1 deletion spec/appraisal/appraisal_spec.rb
Expand Up @@ -6,7 +6,7 @@
appraisal = Appraisal::Appraisal.new('fake', 'fake')
appraisal.stub(:gemfile_path).and_return("/home/test/test directory")

appraisal.bundle_command.should == "bundle install --gemfile='/home/test/test directory'"
appraisal.bundle_command.should == "bundle check --gemfile='/home/test/test directory' || bundle install --gemfile='/home/test/test directory'"
end

it "cleans up spaces and punctuation when outputting its gemfile" do
Expand Down

0 comments on commit ec1caf1

Please sign in to comment.