Sha256: 2c9d52185a9094fb51ad2c751e22e45c31459ef509b1c7713830bbcb6b5bc32d

Contents?: true

Size: 1.32 KB

Versions: 15

Compression:

Stored size: 1.32 KB

Contents

module Inspec::Plugin::V2
  # Track loading status of each plugin.  These are the elements of the Registry.
  #
  # Lifecycle of an installed plugin:
  #  If present in the config file, bundled, or core, it is "known"
  #  All known plugins are loaded.  v1 plugins auto-activate. All loaded plugins know their version.
  #  v2 plugins activate when they are used.  All activated plugins know their implementation class.
  Status = Struct.new(
    :activators,              # Array of Activators - where plugin_type info gets stored
    :api_generation,          # 0,1,2 # TODO: convert all bundled (v0) to v2
    :plugin_class,            # Plugin class
    :entry_point,             # a gem name or filesystem path
    :installation_type,       # :gem, :path, :core, bundle # TODO: combine core and bundle
    :loaded,                  # true, false False could mean not attempted or failed
    :load_exception,          # Exception class if it failed to load
    :name,                    # String name
    :version,                 # three-digit version.  Core / bundled plugins use InSpec version here.
    :description              # Description of plugin.
  ) do
    def initialize(*)
      super
      self[:activators] = []
      self[:loaded] = false
    end

    def plugin_types
      activators.map(&:plugin_type).uniq.sort
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
inspec-core-6.8.11 lib/inspec/plugin/v2/status.rb
inspec-core-5.22.58 lib/inspec/plugin/v2/status.rb
inspec-core-5.22.55 lib/inspec/plugin/v2/status.rb
inspec-core-6.8.1 lib/inspec/plugin/v2/status.rb
inspec-core-5.22.40 lib/inspec/plugin/v2/status.rb
inspec-core-6.6.0 lib/inspec/plugin/v2/status.rb
inspec-core-5.22.36 lib/inspec/plugin/v2/status.rb
inspec-core-5.22.29 lib/inspec/plugin/v2/status.rb
inspec-core-5.22.3 lib/inspec/plugin/v2/status.rb
inspec-core-5.21.29 lib/inspec/plugin/v2/status.rb
inspec-core-5.18.14 lib/inspec/plugin/v2/status.rb
inspec-core-5.17.4 lib/inspec/plugin/v2/status.rb
inspec-core-5.14.0 lib/inspec/plugin/v2/status.rb
inspec-core-5.12.2 lib/inspec/plugin/v2/status.rb
inspec-core-5.10.5 lib/inspec/plugin/v2/status.rb