Sha256: 2c59697d73ca7ea6df456cab3e41d6d7ba27c46950eb2c6eb8441387d709a9c9
Contents?: true
Size: 833 Bytes
Versions: 11
Compression:
Stored size: 833 Bytes
Contents
# frozen_string_literal: true module Coverband module Adapters ### # FilesStore store a merged coverage file to local disk # Generally this is for testing and development # Not recommended for production deployment ### class FileStore < Base def initialize(path, _opts = {}) super() @path = path config_dir = File.dirname(@path) Dir.mkdir config_dir unless File.exist?(config_dir) end def clear! File.delete(path) if File.exist?(path) end private attr_accessor :path def save_coverage(report) File.open(path, 'w') { |f| f.write(report.to_json) } end def get_report if File.exist?(path) JSON.parse(File.read(path)) else {} end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems