Class: Cucover::Store::DiskCache

Inherits:
Object
  • Object
show all
Defined in:
lib/cucover/store.rb

Instance Method Summary collapse

Instance Method Details

#loadObject



56
57
58
59
60
61
# File 'lib/cucover/store.rb', line 56

def load
  return unless File.exists?(data_file)

  Cucover.logger.debug("Reading existing coverage data from #{data_file}")
  File.open(data_file) { |f| Marshal.load(f) }
end

#save(recordings) ⇒ Object



51
52
53
54
# File 'lib/cucover/store.rb', line 51

def save(recordings)
  Cucover.logger.debug("Saving #{recordings.length} recording(s) to #{data_file}")
  File.open(data_file, 'w') { |f| f.puts Marshal.dump(recordings) }
end