Sha256: eb90cfe45a318673843b4c2bbdfd51772842d5b7cc444e6fa404e0d161470b48

Contents?: true

Size: 290 Bytes

Versions: 2

Compression:

Stored size: 290 Bytes

Contents

class LoGspot::Output::File
  def initialize(file_name)
    FileUtils.mkdir_p(File.dirname(file_name))
    @file = File.open(file_name, 'a')
  end

  def puts(data)
    file.puts(data[:message])
    file.flush
  end

  def finalize
    @file.close
  end

  private

  attr_reader :file
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logspot-0.3.0 lib/lo_gspot/output/file.rb
logspot-0.2.0 lib/lo_gspot/output/file.rb