Sha256: 61ee542e626db5780fee171f96426519718c3d17e2853afb079994b479b5fbbc
Contents?: true
Size: 718 Bytes
Versions: 42
Compression:
Stored size: 718 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 #{report_path} doesn't exist. Please generate report first!" end private def report_json Presenter.report_json end end end
Version data entries
42 entries across 42 versions & 1 rubygems