simplecov-cobertura 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d7c7d11c3b4ce40568ebab85bcd7b30ca458e9f
4
- data.tar.gz: da1e2eb057565a9c7313f44d8ca6583862fbef31
3
+ metadata.gz: 811c6f707a717ab4202f9de5f9235854f58c763e
4
+ data.tar.gz: cc42538afcb4724c00afd2db30713c0e13f1d49b
5
5
  SHA512:
6
- metadata.gz: b20ac65140f5f376fd0c736ef55f23b7833d5e9d9017d8f440d6431144f5987a038410dc9bb2fb4f212aa0385547a221af78025247024dab8b88367a20d23f09
7
- data.tar.gz: 2efab639d9a76e680154c03e7551037561f373d697ff83e6d01b7b8860296e8a62525c4af9793e04a334b67e8567a7ed2046e75b9e8e3fc3b5becee9338689cf
6
+ metadata.gz: b14ccf7577b8f90e59a1586b3856e7a84310a82dc97487c8d1a7e5fa9c720702049e7279677c4f2427f3e6d96cc3d3f35661e68381cb112309cce677c6ec7bed
7
+ data.tar.gz: f9fbf6d4c6bf03737a1e3cdabbbd41bd9a4f806bd8f2ead716e58215771a54d8fdb701f756c77a297651ebbc17d9ff1a9eb6e5facc67dc3b9eea824b730461e1
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # simplecov-cobertura [![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)
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
 
@@ -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_ << methods = LibXML::XML::Node.new('methods')
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.gsub(File.join(SimpleCov.root, ''), '')
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
@@ -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.1'
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.1
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-26 00:00:00.000000000 Z
11
+ date: 2014-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler