Class: DockerSync::Dependencies::PackageManager::Apt

Inherits:
Base
  • Object
show all
Defined in:
lib/docker-sync/dependencies/package_managers/apt.rb

Constant Summary collapse

APT_NOT_AVAILABLE =
'APT is not installed. Please install it and try again.'.freeze

Constants inherited from Base

Base::DID_NOT_INSTALL_PACKAGE, Base::FAILED_TO_INSTALL_PACKAGE

Instance Attribute Summary

Attributes inherited from Base

#package

Class Method Summary collapse

Methods inherited from Base

#initialize, install_package

Constructor Details

This class inherits a constructor from DockerSync::Dependencies::PackageManager::Base

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/docker-sync/dependencies/package_managers/apt.rb', line 7

def self.available?
  return @available if defined? @available
  @available = find_executable0('apt-get')
end

.ensure!Object

Raises:



12
13
14
# File 'lib/docker-sync/dependencies/package_managers/apt.rb', line 12

def self.ensure!
  raise(APT_NOT_AVAILABLE) unless available?
end