class Knapsack::Report
Public Instance Methods
config(args={})
click to toggle source
# File lib/knapsack/report.rb, line 5 def config(args={}) @config ||= args @config.merge!(args) end
open()
click to toggle source
# File lib/knapsack/report.rb, line 24 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
report_path()
click to toggle source
# File lib/knapsack/report.rb, line 10 def report_path config[:report_path] || raise('Missing report_path') end
save()
click to toggle source
# File lib/knapsack/report.rb, line 18 def save File.open(report_path, 'w+') do |f| f.write(report_json) end end
test_file_pattern()
click to toggle source
# File lib/knapsack/report.rb, line 14 def test_file_pattern config[:test_file_pattern] || raise('Missing test_file_pattern') end
Private Instance Methods
report_json()
click to toggle source
# File lib/knapsack/report.rb, line 33 def report_json Presenter.report_json end