From 43c6cd0c26fc396b056c9825c785fe2c4315d67e Mon Sep 17 00:00:00 2001 From: Mark Haylock Date: Mon, 27 Jul 2015 21:10:09 +1200 Subject: [PATCH] Added :install_as_deployment and :install_to_path to bundler options --- lib/moonshine/manifest/rails/rails.rb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/moonshine/manifest/rails/rails.rb b/lib/moonshine/manifest/rails/rails.rb index 0172639d..00cb45b7 100644 --- a/lib/moonshine/manifest/rails/rails.rb +++ b/lib/moonshine/manifest/rails/rails.rb @@ -120,15 +120,21 @@ def rails_gems end end - bundle_install_without_groups = configuration[:bundler] && configuration[:bundler][:install_without_groups] || "development test" - bundle_install_options = [ - '--deployment', - "--path #{configuration[:deploy_to]}/shared/bundle", - "--without '#{bundle_install_without_groups}'" - ] + bundler_defaults = { + :install_as_deployment => true, + :install_to_path => "#{configuration[:deploy_to]}/shared/bundle", + :install_without_groups => 'development test', + :disable_binstubs => false + } + + bundler_options = bundler_defaults.with_indifferent_access + .merge(configuration[:bundler] || {}) - unless configuration[:bundler][:disable_binstubs] - bundle_install_options << '--binstubs' + bundle_install_options = [].tap do |options| + options << '--deployment' if bundler_options[:install_as_deployment] + options << "--path #{configuration[:deploy_to]}/shared/bundle" if bundler_options[:install_to_path].present? + options << "--without '#{bundler_options[:install_without_groups]}'" if bundler_options[:install_without_groups].present? + options << '--binstubs' unless configuration[:bundler][:disable_binstubs] end exec 'accept github key',