Class: SupplyDrop::Writer::File

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

Instance Method Summary collapse

Constructor Details

#initialize(writer, file) ⇒ File

Returns a new instance of File.



4
5
6
7
8
9
# File 'lib/supply_drop/writer/file.rb', line 4

def initialize(writer, file)
  @wrapped_writer = writer
  @logger = Capistrano::Logger.new(:output => file)
  @logger.level = Capistrano::Logger::TRACE
  @file_writer = Batched.new(@logger)
end

Instance Method Details

#all_output_collectedObject



16
17
18
19
20
# File 'lib/supply_drop/writer/file.rb', line 16

def all_output_collected
  @wrapped_writer.all_output_collected
  @file_writer.all_output_collected
  @logger.close
end

#collect_output(host, data) ⇒ Object



11
12
13
14
# File 'lib/supply_drop/writer/file.rb', line 11

def collect_output(host, data)
  @wrapped_writer.collect_output(host, data)
  @file_writer.collect_output(host, data)
end