Module: Slather::CoverageService::Hardcover

Defined in:
lib/slather/coverage_service/hardcover.rb

Instance Method Summary collapse

Instance Method Details

#postObject



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/slather/coverage_service/hardcover.rb', line 37

def post
  f = File.open('hardcover_json_file', 'w+')
  begin
    f.write(hardcover_coverage_data)
    f.close
    `curl --form json_file=@#{f.path} #{hardcover_api_jobs_path}`
  rescue StandardError => e
    FileUtils.rm(f)
    raise e
  end
  FileUtils.rm(f)
end