Sha256: b9a2e28bd3d8d565717e7748e3a49589a70fe38fa293f8ce429ede5a94014e75

Contents?: true

Size: 674 Bytes

Versions: 15

Compression:

Stored size: 674 Bytes

Contents

class BaseFormatter
  attr_reader :ext

  def initialize(report)
    @head = report.head.clone
    @lines = report.lines.clone
    @tail = report.tail.clone
    @ext = "unkown"
  end

  def process(options = {})
    raise "Empty method!"
  end

  def init(filename)
    @filename = "#{filename}.#{@ext}"
    @file = File.open(@filename, "w")
  end

  ##
  # Write data into output file
  # @param text (String) Text data to write into output file
  def w(text)
    @file.write text.to_s
  end

  def deinit
    @file.close
  end

  def trim(input)
    output = input.to_s
    output = "...#{input[input.size - 50, input.size]}" if output.size > 65
    output.to_s
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
teuton-2.9.2 lib/teuton/report/formatter/base_formatter.rb
teuton-2.9.1 lib/teuton/report/formatter/base_formatter.rb
teuton-2.9.0 lib/teuton/report/formatter/base_formatter.rb
teuton-2.8.0 lib/teuton/report/formatter/base_formatter.rb
teuton-2.7.3 lib/teuton/report/formatter/base_formatter.rb
teuton-2.7.2 lib/teuton/report/formatter/base_formatter.rb
teuton-2.7.1 lib/teuton/report/formatter/base_formatter.rb
teuton-2.7.0 lib/teuton/report/formatter/base_formatter.rb
teuton-2.6.0 lib/teuton/report/formatter/base_formatter.rb
teuton-2.5.0 lib/teuton/report/formatter/base_formatter.rb
teuton-2.4.5 lib/teuton/report/formatter/base_formatter.rb
teuton-2.4.4 lib/teuton/report/formatter/base_formatter.rb
teuton-2.4.3 lib/teuton/report/formatter/base_formatter.rb
teuton-2.4.2 lib/teuton/report/formatter/base_formatter.rb
teuton-2.4.1 lib/teuton/report/formatter/base_formatter.rb