Sha256: 7566de2b6d5d7478a94c1151e2f98183227adb1c85418c07f7425cc1314b8174

Contents?: true

Size: 706 Bytes

Versions: 32

Compression:

Stored size: 706 Bytes

Contents

require 'forwardable'

module DockerSync
  module Dependencies
    module PackageManager
      class << self
        extend Forwardable
        def_delegators :package_manager, :available?, :ensure!, :install_package
      end

      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

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
docker-sync-1.0.5 lib/docker-sync/dependencies/package_manager.rb
docker-sync-1.0.4 lib/docker-sync/dependencies/package_manager.rb
docker-sync-1.0.3 lib/docker-sync/dependencies/package_manager.rb
docker-sync-1.0.2 lib/docker-sync/dependencies/package_manager.rb
docker-sync-1.0.1 lib/docker-sync/dependencies/package_manager.rb
docker-sync-1.0.0 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.7.2 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.7.1 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.7.0 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.6.0 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.14 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.13 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.11 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.11.pre.beta3 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.11.pre.beta2 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.11.pre.beta1 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.10 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.10.pre.beta1 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.9 lib/docker-sync/dependencies/package_manager.rb
docker-sync-0.5.8 lib/docker-sync/dependencies/package_manager.rb