simplecov-cobertura 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/simplecov-cobertura.rb +4 -6
- data/simplecov-cobertura.gemspec +1 -1
- data/test/simplecov-cobertura_test.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 811c6f707a717ab4202f9de5f9235854f58c763e
|
4
|
+
data.tar.gz: cc42538afcb4724c00afd2db30713c0e13f1d49b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b14ccf7577b8f90e59a1586b3856e7a84310a82dc97487c8d1a7e5fa9c720702049e7279677c4f2427f3e6d96cc3d3f35661e68381cb112309cce677c6ec7bed
|
7
|
+
data.tar.gz: f9fbf6d4c6bf03737a1e3cdabbbd41bd9a4f806bd8f2ead716e58215771a54d8fdb701f756c77a297651ebbc17d9ff1a9eb6e5facc67dc3b9eea824b730461e1
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# simplecov-cobertura
|
1
|
+
# simplecov-cobertura
|
2
|
+
[![Build Status](https://api.shippable.com/projects/549b1fbbd46935d5fbc0f9f3/badge?branchName=master)](https://app.shippable.com/projects/549b1fbbd46935d5fbc0f9f3/builds/latest) [![Gem Version](https://badge.fury.io/rb/simplecov-cobertura.svg)](http://badge.fury.io/rb/simplecov-cobertura) [![Downloads](http://ruby-gem-downloads-badge.herokuapp.com/simplecov-cobertura?type=total)](https://rubygems.org/gems/simplecov-cobertura)
|
2
3
|
|
3
4
|
Produces [Cobertura](http://cobertura.sourceforge.net/) formatted XML from [SimpleCov](https://github.com/colszowka/simplecov).
|
4
5
|
|
data/lib/simplecov-cobertura.rb
CHANGED
@@ -10,15 +10,13 @@ class SimpleCov::Formatter::CoberturaFormatter
|
|
10
10
|
|
11
11
|
result_path = File.join( SimpleCov.coverage_path, RESULT_FILE_NAME )
|
12
12
|
File.write(result_path, xml)
|
13
|
-
|
14
13
|
puts "Coverage report generated for #{result.command_name} to #{result_path}"
|
15
|
-
|
16
|
-
return xml
|
14
|
+
xml
|
17
15
|
end
|
18
16
|
|
19
17
|
private
|
20
18
|
def result_to_xml(result)
|
21
|
-
doc = LibXML::XML::Document.new
|
19
|
+
doc = LibXML::XML::Document.new
|
22
20
|
doc.root = LibXML::XML::Node.new('coverage')
|
23
21
|
coverage = doc.root
|
24
22
|
|
@@ -38,7 +36,7 @@ class SimpleCov::Formatter::CoberturaFormatter
|
|
38
36
|
classes << class_ = LibXML::XML::Node.new('class')
|
39
37
|
set_class_attributes(class_, file)
|
40
38
|
|
41
|
-
class_ <<
|
39
|
+
class_ << LibXML::XML::Node.new('methods')
|
42
40
|
class_ << lines = LibXML::XML::Node.new('lines')
|
43
41
|
|
44
42
|
file.lines.each do |file_line|
|
@@ -74,7 +72,7 @@ class SimpleCov::Formatter::CoberturaFormatter
|
|
74
72
|
|
75
73
|
def set_class_attributes(class_, file)
|
76
74
|
filename = file.filename
|
77
|
-
path = filename
|
75
|
+
path = filename[SimpleCov.root.length+1..-1]
|
78
76
|
class_['name'] = File.basename(filename, '.*')
|
79
77
|
class_['filename'] = path
|
80
78
|
class_['line-rate'] = (file.covered_percent/100).round(2).to_s
|
data/simplecov-cobertura.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'simplecov-cobertura'
|
7
|
-
spec.version = '1.0.
|
7
|
+
spec.version = '1.0.2'
|
8
8
|
spec.authors = ['Jesse Bowes']
|
9
9
|
spec.email = ['jbowes@dashingrocket.com']
|
10
10
|
spec.summary = 'SimpleCov Cobertura Formatter'
|
@@ -24,8 +24,6 @@ class CoberturaFormatterTest < Test::Unit::TestCase
|
|
24
24
|
def test_format_dtd_validates
|
25
25
|
xml = @formatter.format(@result)
|
26
26
|
|
27
|
-
STDERR.puts xml
|
28
|
-
|
29
27
|
dtd_text = open(SimpleCov::Formatter::CoberturaFormatter::DTD_URL) { |io| io.read }
|
30
28
|
dtd = LibXML::XML::Dtd.new(dtd_text)
|
31
29
|
doc = LibXML::XML::Document.string(xml)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov-cobertura
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Bowes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|