Sha256: a77faff48b7f343389896100083b6d0ab9e1d95af7b2f6ab58d60cce4aff3955
Contents?: true
Size: 1012 Bytes
Versions: 3
Compression:
Stored size: 1012 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 def size File.size?(path).to_i end def migrate! raise NotImplementedError, "FileStore doesn't support migrations" end private attr_accessor :path def save_coverage(report) File.open(path, 'w') { |f| f.write(report.to_json) } end def get_report(_local_type = nil) if File.exist?(path) JSON.parse(File.read(path)) else {} end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
coverband-4.2.1.rc3 | lib/coverband/adapters/file_store.rb |
coverband-4.2.1.rc2 | lib/coverband/adapters/file_store.rb |
coverband-4.2.1.rc1 | lib/coverband/adapters/file_store.rb |