Module: SimpleCov::LastRun

Defined in:
lib/simplecov/last_run.rb

Class Method Summary collapse

Class Method Details

.last_run_pathObject


3
4
5
# File 'lib/simplecov/last_run.rb', line 3

def last_run_path
  File.join(SimpleCov.coverage_path, '.last_run.json')
end

.readObject


7
8
9
10
11
# File 'lib/simplecov/last_run.rb', line 7

def read
  return nil unless File.exist?(last_run_path)

  SimpleCov::JSON.parse(File.read(last_run_path))
end

.write(json) ⇒ Object


13
14
15
16
17
# File 'lib/simplecov/last_run.rb', line 13

def write(json)
  File.open(last_run_path, "w+") do |f|
    f.puts SimpleCov::JSON.dump(json)
  end
end