lib/pah/partials/_gems.rb in pah-0.0.13 vs lib/pah/partials/_gems.rb in pah-0.0.14

- old
+ new

@@ -1,14 +1,22 @@ copy_static_file 'Gemfile' -in_root do - gsub_file 'Gemfile', /RAILS_VERSION/, ::Pah::RAILS_VERSION +gsub_file 'Gemfile', /RAILS_VERSION/, ::Pah::RAILS_VERSION - # Since the gemset is likely empty, manually install bundler so it can install the rest - run "gem install bundler --no-ri --no-rdoc" +begin + require 'bundler' +rescue LoadError + # Install bundler if needed + if !(run "gem install bundler --no-ri --no-rdoc") + puts "Error installing bundler, will attempt to continue" + end + require 'bundler' +end - # Install all other gems needed from Gemfile - run "bundle install" +# Install all other gems needed from Gemfile +if !(run "bundle install --jobs=4") + puts "Error installing gems, aborting" + exit 1 end git add: 'Gemfile*' -git_commit 'Add Gemfile and Gemfile.lock.' \ No newline at end of file +git_commit 'Add Gemfile and Gemfile.lock.'