9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/simplecov/cli/serve/report_preparer.rb', line 9
def self.call(dir)
index_path = File.join(dir, "index.html")
json_path = File.join(dir, "coverage.json")
return "#{dir} doesn't exist; run your test suite first" unless File.directory?(dir)
return if File.file?(index_path)
return "#{dir} has no index.html or coverage.json; run your test suite first" unless File.file?(json_path)
build_index(json_path, dir)
rescue CoverageJSON::Error, SystemCallError => e
"cannot build index.html from #{json_path}: #{e}"
end
|