class Taeval::Reporter
Public Class Methods
new(conf_h)
click to toggle source
# File lib/taeval/reporter.rb, line 9 def initialize(conf_h) @path = path_of(conf_h.dig('report', 'path')) @records = {} end
Public Instance Methods
add(data)
click to toggle source
# File lib/taeval/reporter.rb, line 14 def add(data) @records[data[:repo]] = {} if !@records.has_key?(data[:repo]) @records[data[:repo]][data[:runner]] = [] if !@records[data[:repo]].has_key?(data[:runner]) @records[data[:repo]][data[:runner]] << data[:msg] end
save()
click to toggle source
# File lib/taeval/reporter.rb, line 20 def save p "Reporter#save..." File.open(@path,'w') do |f| f.write(@records.to_json) end end