Class: SupplyDrop::Writer::Batched

Inherits:
Object
  • Object
show all
Defined in:
lib/supply_drop/writer/batched.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ Batched

Returns a new instance of Batched.



4
5
6
7
# File 'lib/supply_drop/writer/batched.rb', line 4

def initialize(logger)
  @outputs = {}
  @logger = logger
end

Instance Method Details

#all_output_collectedObject



14
15
16
17
18
19
# File 'lib/supply_drop/writer/batched.rb', line 14

def all_output_collected
  @outputs.keys.sort.each do |host|
    @logger.info "Puppet output for #{host}"
    @logger.debug @outputs[host], host
  end
end

#collect_output(host, data) ⇒ Object



9
10
11
12
# File 'lib/supply_drop/writer/batched.rb', line 9

def collect_output(host, data)
  @outputs[host] ||= ""
  @outputs[host] << data
end