Module: Capstrap::Apt

Defined in:
lib/capistrano/ext/capstrap/apt.rb

Constant Summary collapse

APT_RVM_PKGS =
%w{sed grep tar gzip bzip2 bash curl git-core}
APT_MRI_AND_REE_PKGS =
%w{build-essential bison openssl libreadline6 
libreadline6-dev zlib1g zlib1g-dev libssl-dev libsqlite3-0 
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev subversion autoconf
ssl-cert}

Class Method Summary collapse

Class Method Details

.load_into(configuration) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/capistrano/ext/capstrap/apt.rb', line 11

def self.load_into(configuration)
  configuration.load do

    def self.task_name(pkg)
      pkg.gsub(/-/, "_").to_sym
    end

    namespace :apt do
      desc "Resynchronizes the package index files."
      task :update do
        unless @updated
          apt_update
          @updated = true
        end
      end

      namespace :install do
        desc "Installs packages for running RVM"
        task :rvm_depends do
          apt_install APT_RVM_PKGS.join(" ")
        end
        
        desc "Installs packages for running MRI/REE."
        task :mri_depends do
          apt_install APT_MRI_AND_REE_PKGS.join(" ")
        end
        
        desc "Installs all packages via apt-get."
        task :default do
          rvm_depends
          mri_depends
        end
      end
    end

    before "apt:install:rvm_depends", "apt:update"
    before "apt:install:mri_depends", "apt:update"
  end
end