Class: Contrast::Agent::Inventory::DependencyAnalysis

Inherits:
Object
  • Object
show all
Includes:
Dependencies, Components::Interface, Singleton
Defined in:
lib/contrast/agent/inventory/dependency_analysis.rb

Overview

Used to collect dependencies of the application for reporting

Constant Summary

Constants included from Dependencies

Contrast::Agent::Inventory::Dependencies::CONTRAST_AGENT

Instance Method Summary collapse

Methods included from Components::Interface

included

Methods included from Dependencies

#loaded_specs

Instance Method Details

#library_pb_listArray<Contrast::Api::Dtm::Library>

Report the dependencies of this application

Returns:



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/contrast/agent/inventory/dependency_analysis.rb', line 23

def library_pb_list
  return Contrast::Utils::ObjectShare::EMPTY_ARRAY unless INVENTORY.enabled?
  return Contrast::Utils::ObjectShare::EMPTY_ARRAY unless INVENTORY.analyze_libraries?

  loaded_specs.each_with_object([]) do |(_name, spec), reported_lib_list|
    next unless spec
    next unless (digest = Contrast::Utils::Sha256Builder.instance.build_from_spec(spec))

    reported_lib_list << Contrast::Api::Dtm::Library.build(digest, spec)
  end
end