Sha256: 62559567be5de2eea6c8f7bcdfc0b3543cceb76219c19c14d98079ff85744750

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

module Capstrap
  module Apt

    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}

    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
  end
end

if Capistrano::Configuration.instance
  Capstrap::Apt.load_into(Capistrano::Configuration.instance)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capstrap-0.4.1 lib/capistrano/ext/capstrap/apt.rb
capstrap-0.4.0 lib/capistrano/ext/capstrap/apt.rb