No commit activity in last 3 years
No release in over 3 years
Covert Cobertura XML to Coveralls source files payload
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6.4
~> 0.10
~> 10.1
~> 3.1.0

Runtime

~> 0.5.0
~> 1.3.0
 Project Readme

Coveralls::Cobertura

Build Status Dependency Status Code Climate Coverage Status

Convert Cobertura XML to Coveralls source files payload.

Installation

If you're using bundler, place the following in your Gemfile:

gem 'coveralls-cobertura', '~> 1.0.0'

Otherwise, just install the gem:

gem install coveralls-cobertura

Usage

# Leverage the coveralls gem
require 'coveralls'
# Include this gem
require 'coveralls-cobertura'
# Coveralls endpoint that we want to send coverage data to
JOBS_ENDPOINT = 'jobs'
# Assumes you already have a payload
existing_source_files = payload[:source_files]
# Cobertura XML file
filename = 'path/to/cobertura.xml'
# Create a Converter instance
converter = Coveralls::Cobertura::Converter.new(filename)
# Convert to Coveralls
cobertura_source_files = converter.convert
# Add in the Cobertura generated source files
payload[:source_files] = existing_source_files + cobertura_source_files
Coveralls::API.post_json(JOBS_ENDPOINT, payload)