Sha256: c76384414c230de5bd094f4e60d6d85e042e47b4763a78353db44d8584842dcd

Contents?: true

Size: 727 Bytes

Versions: 4

Compression:

Stored size: 727 Bytes

Contents

module Koma
  class HostInventory
    EXTRA_KEYS = %w(package service)
    DISABLED_KEYS = %w(ec2)

    def self.inventory_keys
      Specinfra::HostInventory::KEYS + EXTRA_KEYS - DISABLED_KEYS
    end

    def self.all_inventory_keys
      Specinfra::HostInventory::KEYS + EXTRA_KEYS
    end

    def self.disabled_keys
      DISABLED_KEYS
    end

    def each
      inventory_keys.each do |k|
        yield k, self[k]
      end
    end

    def each_key
      inventory_keys.each do |k|
        yield k
      end
    end

    def each_value
      inventory_keys.each do |k|
        yield self[k]
      end
    end
  end
end

Koma::HostInventory::EXTRA_KEYS.each do |k|
  require "koma/ext/specinfra/host_inventory/#{k}"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
koma-0.17.0 lib/koma/host_inventory.rb
koma-0.16.0 lib/koma/host_inventory.rb
koma-0.15.0 lib/koma/host_inventory.rb
koma-0.14.0 lib/koma/host_inventory.rb