Module: CapistranoDeploy::Bundle

Defined in:
lib/capistrano-deploy/bundle.rb

Class Method Summary collapse

Class Method Details

.load_into(configuration) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/capistrano-deploy/bundle.rb', line 3

def self.load_into(configuration)
  configuration.load do
    namespace :bundle do
      desc 'Install gems'
      task :install, :except => {:no_release => true} do
        bundle_cmd = fetch(:bundle_cmd, 'bundle')
        bundle_flags = fetch(:bundle_flags, '--deployment --quiet')
        bundle_without = [*fetch(:bundle_without, [:development, :test])].compact

        args = [bundle_flags.to_s]
        args << "--without #{bundle_without.join(' ')}" unless bundle_without.empty?

        run "cd #{deploy_to} && #{bundle_cmd} install #{args.join(' ')}"
      end
    end
  end
end