Class: PuppetX::Puppetlabs::Migration::MigrationChecker::MigrationIssueAcceptor

Inherits:
Puppet::Pops::Validation::Acceptor
  • Object
show all
Defined in:
lib/puppet_x/puppetlabs/migration/migration_checker.rb

Overview

An acceptor of migration issues that only accepts diagnostics for a given [file, line, pos, issue, severity] once in its lifetime

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMigrationIssueAcceptor

Returns a new instance of MigrationIssueAcceptor.



34
35
36
37
# File 'lib/puppet_x/puppetlabs/migration/migration_checker.rb', line 34

def initialize
  @reported = Set.new
  super
end

Instance Attribute Details

#diagnosticsObject (readonly)

Returns the value of attribute diagnostics.



32
33
34
# File 'lib/puppet_x/puppetlabs/migration/migration_checker.rb', line 32

def diagnostics
  @diagnostics
end

Instance Method Details

#accept(diagnostic) ⇒ Object



39
40
41
42
43
44
# File 'lib/puppet_x/puppetlabs/migration/migration_checker.rb', line 39

def accept(diagnostic)
  # Only accept unique diagnostics (unique == same issue, file, line, pos and severity)
  return unless @reported.add?(diagnostic)
  # Collect the diagnostic per severity and remember
  super diagnostic
end