maven_emma_for_gitlab 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6679084c7f130b92ac0c91638cba69e6b20b014f
4
+ data.tar.gz: b2ff03d2b1a58934a71f01f16c6aa97be0f70ecd
5
+ SHA512:
6
+ metadata.gz: f63413fc9eaa73fb9a16a43e33445dc9f77c9ba80b94e39902cbe0cfc5e7bc59c46ea148ff908623d3951660ca408a6fb8193c67e1f5eb939c14721c4b3c3d81
7
+ data.tar.gz: 43aca33b13d52480a84726bacb90b120b6d84baf3b667854bb71ce5f2d3b58e6d097aba29e1d4177d91e23ae5ea55f9b4bd549c0c59e2fa4af6935bbd27cbe85
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'maven_emma_for_gitlab'
4
+
5
+ MavenEmmaForGitLab.print_coverage
6
+ # Always succeed, so we don't accidentally cause a build to fail.
7
+ exit 0
@@ -0,0 +1,21 @@
1
+ require 'nokogiri'
2
+
3
+ module MavenEmmaForGitLab
4
+ FILE_LOCATION = 'target/site/emma/coverage.xml'
5
+ def self.print_coverage
6
+ unless File.exists? FILE_LOCATION
7
+ puts 'No coverage file found.'
8
+ return
9
+ end
10
+ doc = Nokogiri::XML(File.open(FILE_LOCATION).read())
11
+ coverages = doc.xpath('//all/coverage')
12
+ puts "Overall code coverage:"
13
+ coverages.each do |coverage|
14
+ output = ' '
15
+ output << coverage['type'].split(',').first.capitalize
16
+ output << ': '
17
+ output << coverage['value'].split(/\s/).first
18
+ puts output
19
+ end
20
+ end
21
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: maven_emma_for_gitlab
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Will Richardson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-03-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nokogiri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.6.7.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.6.7.1
27
+ description:
28
+ email: william.hamish@gmail.com
29
+ executables:
30
+ - emma_print_coverage
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - bin/emma_print_coverage
35
+ - lib/maven_emma_for_gitlab.rb
36
+ homepage: http://javanut.net/maven_emma_for_gitlab
37
+ licenses:
38
+ - MIT
39
+ metadata: {}
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project:
56
+ rubygems_version: 2.4.8
57
+ signing_key:
58
+ specification_version: 4
59
+ summary: Parses and prints the Emma code coverage so it can be read by gitlab CI
60
+ test_files: []