Class: Inspec::Plugin::V2::Status

Inherits:
Struct
  • Object
show all
Defined in:
lib/inspec/plugin/v2/status.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#to_h

Constructor Details

#initializeStatus



19
20
21
22
23
# File 'lib/inspec/plugin/v2/status.rb', line 19

def initialize(*)
  super
  self[:activators] = []
  self[:loaded] = false
end

Instance Attribute Details

#activatorsObject

Returns the value of attribute activators



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def activators
  @activators
end

#api_generationObject

Returns the value of attribute api_generation



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def api_generation
  @api_generation
end

#entry_pointObject

Returns the value of attribute entry_point



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def entry_point
  @entry_point
end

#installation_typeObject

Returns the value of attribute installation_type



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def installation_type
  @installation_type
end

#load_exceptionObject

Returns the value of attribute load_exception



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def load_exception
  @load_exception
end

#loadedObject

Returns the value of attribute loaded



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def loaded
  @loaded
end

#nameObject

Returns the value of attribute name



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def name
  @name
end

#plugin_classObject

Returns the value of attribute plugin_class



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def plugin_class
  @plugin_class
end

#versionObject

Returns the value of attribute version



8
9
10
# File 'lib/inspec/plugin/v2/status.rb', line 8

def version
  @version
end

Instance Method Details

#plugin_typesObject



25
26
27
# File 'lib/inspec/plugin/v2/status.rb', line 25

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