Sha256: bc045bec28ddcf7d5cda1f6e7dfaa697b3a2a72bc669e8bbb131f606f06aa074

Contents?: true

Size: 1.16 KB

Versions: 36

Compression:

Stored size: 1.16 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../utilities')

Capistrano::Configuration.instance(true).load do
  namespace :aptitude do
    desc "Updates all installed packages on aptitude package system"
    task :updates do
      sudo "apt-get -qy update"
      utilities.apt_upgrade
      sudo "apt-get -qy autoremove"
    end

    desc "Installs a specified aptitude package"
    task :install do
      deb_pkg_name = utilities.ask "Enter name of the package(s) you wish to install:"
      raise "Please specify deb_pkg_name" if deb_pkg_name == ''
      logger.info "Updating packages..."
      sudo "aptitude update"
      logger.info "Installing #{deb_pkg_name}..."
      utilities.apt_install deb_pkg_name
    end

    desc "Removes a specified aptitude package"
    task :remove do
      deb_pkg_name = utilities.ask "Enter name of the package(s) you wish to remove:"
      raise "Please specify deb_pkg_name" if deb_pkg_name == ''
      logger.info "Updating packages..."
      sudo "aptitude update"
      logger.info "Removing #{deb_pkg_name}..."
      utilities.sudo_with_input "apt-get remove --purge #{deb_pkg_name}", /^Do you want to continue\?/
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
crazycode-cap-recipes-0.5.3 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.5.2 lib/cap_recipes/tasks/aptitude/manage.rb
cap-recipes-0.3.39 lib/cap_recipes/tasks/aptitude/manage.rb
cap-recipes-0.3.38 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.5.1 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.5.0 lib/cap_recipes/tasks/aptitude/manage.rb
cap-recipes-0.3.37 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.14 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.13 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.12 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.11 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.10 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.9 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.8 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.6 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.5 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.4 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.3 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.2 lib/cap_recipes/tasks/aptitude/manage.rb
crazycode-cap-recipes-0.4.1 lib/cap_recipes/tasks/aptitude/manage.rb