Sha256: e8f1f09c2bb2bc2a0b5de54760d9feb32821f62cd03fc8c5e30630d52635ec89
Contents?: true
Size: 703 Bytes
Versions: 7
Compression:
Stored size: 703 Bytes
Contents
module Knapsack class Report include Singleton def config(args={}) @config ||= args @config.merge!(args) end def report_path config[:report_path] || raise('Missing report_path') end def test_file_pattern config[:test_file_pattern] || raise('Missing test_file_pattern') end def save File.open(report_path, 'w+') do |f| f.write(report_json) end end def open report = File.read(report_path) JSON.parse(report) rescue Errno::ENOENT raise "Knapsack report file doesn't exist. Please generate report first!" end private def report_json Presenter.report_json end end end
Version data entries
7 entries across 7 versions & 1 rubygems