Sha256: 3e2fc13e8ce5321df3955700f0828614e1440a7d2dcd873f8287654ddb496be9
Contents?: true
Size: 620 Bytes
Versions: 5
Compression:
Stored size: 620 Bytes
Contents
# frozen_string_literal: true class BaseFormatter def initialize(report) @head = report.head @lines = report.lines @tail = report.tail end def process raise "Empty method!" end def init(filename) @filename = filename @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
5 entries across 5 versions & 1 rubygems