Sha256: a4ab2c666b5798f561030f5444330f799c14a7f713708c8cc180eb8be8fca7d1
Contents?: true
Size: 1.14 KB
Versions: 2
Compression:
Stored size: 1.14 KB
Contents
module Snuffle module Formatters module Base def self.included(klass) klass.send(:attr_accessor, :summary) klass.send(:attr_accessor, :source) end def initialize(summary, source="") self.summary = summary self.source = source end def content [header, rows, footer].flatten.join("\r\n") end def columns ["filename", "host class", "candidate object attributes", "source line numbers"] end def root_path "doc/snuffle" end def output_path return @output_path if @output_path path = root_path path << "/" + summary.path_to_results if summary FileUtils.mkpath(path) @output_path = path end def path_to_results "#{output_path}/#{filename}" end def filename base = "#{summary.filename}" base + file_extension end def file_extension "" end def export outfile = File.open("#{path_to_results}", 'w') outfile.write(content) outfile.close path_to_results end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
snuffle-0.13.0 | lib/snuffle/formatters/base.rb |
snuffle-0.12.2 | lib/snuffle/formatters/base.rb |