diff --git a/butler-deploy.gemspec b/butler-deploy.gemspec index 34e9ef4..865eb4d 100644 --- a/butler-deploy.gemspec +++ b/butler-deploy.gemspec @@ -20,4 +20,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.8" spec.add_development_dependency "rake", "~> 10.0" + + spec.add_development_dependency "capistrano-pending" end diff --git a/lib/generators/butler/deploy/install_generator.rb b/lib/generators/butler/deploy/install_generator.rb index 2510504..1858b01 100644 --- a/lib/generators/butler/deploy/install_generator.rb +++ b/lib/generators/butler/deploy/install_generator.rb @@ -18,7 +18,7 @@ def add_gems gem 'capistrano-chruby', '~> 0.1.1' end - run 'bundle' + bundle_install end def capify @@ -67,7 +67,7 @@ def add_unicorn_gem gem 'unicorn-rails' end - run 'bundle' + bundle_install end def copy_unicorn_config @@ -75,6 +75,21 @@ def copy_unicorn_config template 'unicorn/staging.rb', File.join('config', 'unicorn', 'staging.rb') end + def capistrano_pending + gem_group :development do + gem 'capistrano-pending', require: false + end + + append_to_file 'Capfile', "require 'capistrano-pending'" + + bundle_install + end + + private + + def bundle_install + run 'bundle' + end end end end