Class: Chronos::Application::DependencyReporter
- Inherits:
-
Object
- Object
- Chronos::Application::DependencyReporter
- Defined in:
- lib/chronos/application/dependency_reporter.rb
Overview
Builds one bounded inventory from already loaded runtime components.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(config, options = {}) ⇒ DependencyReporter
constructor
A new instance of DependencyReporter.
- #reset(release = nil) ⇒ Object
Constructor Details
#initialize(config, options = {}) ⇒ DependencyReporter
Returns a new instance of DependencyReporter.
16 17 18 19 20 21 22 23 |
# File 'lib/chronos/application/dependency_reporter.rb', line 16 def initialize(config, = {}) @config = config @loaded_specs = [:loaded_specs] || proc { Gem.loaded_specs } @constants = [:constants] || {} @mutex = Mutex.new @reported = false @release_override = nil end |
Instance Method Details
#call ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/chronos/application/dependency_reporter.rb', line 35 def call @mutex.synchronize do return nil if @reported || !@config.dependency_reporting @reported = true build_payload end rescue StandardError nil end |
#reset(release = nil) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/chronos/application/dependency_reporter.rb', line 25 def reset(release = nil) @mutex.synchronize do @release_override = bounded(release, 128) @reported = false end true rescue StandardError false end |