Module: DockerSync::Dependencies::PackageManager

Extended by:
Forwardable
Defined in:
lib/docker-sync/dependencies/package_manager.rb,
lib/docker-sync/dependencies/package_managers/apt.rb,
lib/docker-sync/dependencies/package_managers/pkg.rb,
lib/docker-sync/dependencies/package_managers/yum.rb,
lib/docker-sync/dependencies/package_managers/base.rb,
lib/docker-sync/dependencies/package_managers/brew.rb,
lib/docker-sync/dependencies/package_managers/none.rb

Defined Under Namespace

Classes: Apt, Base, Brew, None, Pkg, Yum

Class Method Summary collapse

Class Method Details

.package_managerObject



11
12
13
14
15
16
17
# File 'lib/docker-sync/dependencies/package_manager.rb', line 11

def self.package_manager
  return @package_manager if defined? @package_manager
  supported_package_managers.each do |package_manager|
    return @package_manager = package_manager if package_manager.available?
  end
  @package_manager = PackageManager::None
end

.supported_package_managersObject



19
20
21
# File 'lib/docker-sync/dependencies/package_manager.rb', line 19

def self.supported_package_managers
  ObjectSpace.each_object(::Class).select { |klass| klass < self::Base && klass != self::None }
end