Class: Upkeep::HerbSupport::SourceInstrumenter

Inherits:
Object
  • Object
show all
Defined in:
lib/upkeep/herb/source_instrumenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(manifest:) ⇒ SourceInstrumenter

Returns a new instance of SourceInstrumenter.



8
9
10
# File 'lib/upkeep/herb/source_instrumenter.rb', line 8

def initialize(manifest:)
  @manifest = manifest
end

Instance Method Details

#instrument(source) ⇒ Object



12
13
14
15
16
# File 'lib/upkeep/herb/source_instrumenter.rb', line 12

def instrument(source)
  return source unless manifest.parse.fetch(:ok)

  apply_replacements(source, replacements_for(source))
end