simplecov-markdown 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77fb685487952f563a34ebdda156bbddbe51bc2f
4
- data.tar.gz: 537dbf2962b297c5c94b03f1d4911e4787781304
3
+ metadata.gz: ca464ea526ad147010d6d28ac244d0f6320ed432
4
+ data.tar.gz: 39669c96b05fc0890a2315e7779a0148fc6a9460
5
5
  SHA512:
6
- metadata.gz: c4e012ceada38b895f8213488e83828181bf631bc5a0f196115b3a27d8c734bfd7adbb551bcbb94dd88339d672bce45edbb70d79b37c1de1f6717a14cff4dd55
7
- data.tar.gz: f32508b3981c3668209ce95ccae55f9f65275583cdd30208e09dffe74195f56821712a755539ece176db8ca9922f8c61dd0a9bd7dc98a76531111fb8fab5dc08
6
+ metadata.gz: ca2d615c435bce00362b656c8a39154a1a88357dd57eb482d6176ba0bd555adcf72b1cf6d11145cd54894cb6dd9a52083883854487cb162c8e8e890ec55834f0
7
+ data.tar.gz: d661169acffbcee937a368eadd5ca810f679d8c11f177170e6eb87bd144a72e7180da6c0f8984a3ef93aa0afad610ed5875c4f29c2ebe261735b5016be43629a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simplecov-markdown (0.1.1)
4
+ simplecov-markdown (0.1.2)
5
5
  simplecov
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  SimpleCov Markdown Formatter
2
2
  ==================================
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/simplecov-markdown.svg)](http://badge.fury.io/rb/simplecov-markdown)
4
5
  [![Build Status](https://travis-ci.org/holyshared/simplecov-markdown.svg?branch=master)](https://travis-ci.org/holyshared/simplecov-markdown)
5
6
  [![Coverage Status](https://coveralls.io/repos/holyshared/simplecov-markdown/badge.png)](https://coveralls.io/r/holyshared/simplecov-markdown)
7
+ [![Code Climate](https://codeclimate.com/github/holyshared/simplecov-markdown/badges/gpa.svg)](https://codeclimate.com/github/holyshared/simplecov-markdown)
6
8
 
7
9
  Install
8
10
  ----------------------------
@@ -1,8 +1,7 @@
1
1
  module SimpleCov
2
2
  module Formatter
3
3
  class MarkdownFormatter
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
6
6
  end
7
7
  end
8
-
@@ -4,6 +4,7 @@ class SimpleCov::Formatter::MarkdownFormatter
4
4
  def format(result)
5
5
  report_writer = ReportWriter.new(SimpleCov::Formatter::MarkdownFormatter.output_path)
6
6
  report_writer.write_header "Code Coverage Report"
7
+ report_writer.write_description(result)
7
8
  report_writer.write_result(result)
8
9
  report_writer.destroy!
9
10
  end
@@ -21,13 +22,26 @@ class SimpleCov::Formatter::MarkdownFormatter
21
22
 
22
23
  def write_header(title)
23
24
  @report.puts title
24
- @report.puts "=" * 20 + "\n\n"
25
+ @report.puts "=" * 20
26
+ @report.puts "\n"
27
+ end
28
+
29
+ def write_description(result)
30
+ @report.puts "Project name: " + SimpleCov.project_name
31
+ @report.puts "Created at: " + result.created_at.to_s
32
+ @report.puts "\n"
25
33
  end
26
34
 
27
35
  def write_result(result)
28
36
  @table_writer.write_header
29
37
  result.files.each do |file|
30
- @table_writer.write_record(file.filename, file.covered_percent.to_s + "%")
38
+ @table_writer.write_record(
39
+ file.filename,
40
+ file.covered_percent.round(2).to_s + "%",
41
+ file.covered_lines.size,
42
+ file.missed_lines.size,
43
+ file.lines_of_code
44
+ )
31
45
  end
32
46
  @table_writer.destroy!
33
47
  end
@@ -43,8 +57,8 @@ class SimpleCov::Formatter::MarkdownFormatter
43
57
 
44
58
  def initialize(report)
45
59
  @report = report
46
- @columns_headers = ["File", "Coverage"]
47
- @columns_header_aligns = [:left, :right]
60
+ @columns_headers = ["File", "Coverage", "Covered", "Missed", "Total"]
61
+ @columns_header_aligns = [:left, :right, :right, :right, :right]
48
62
  end
49
63
 
50
64
  def write_header
@@ -1,7 +1,10 @@
1
1
  Code Coverage Report
2
2
  ====================
3
3
 
4
- |File|Coverage|
5
- |:--|--:|
6
- |<%= root_directory %>/fixtures/sample1.rb|100.0%|
7
- |<%= root_directory %>/fixtures/sample2.rb|80.0%|
4
+ Project name: <%= project_name %>
5
+ Created at: <%= created_at %>
6
+
7
+ |File|Coverage|Covered|Missed|Total|
8
+ |:--|--:|--:|--:|--:|
9
+ |<%= root_directory %>/fixtures/sample1.rb|100.0%|5|0|5|
10
+ |<%= root_directory %>/fixtures/sample2.rb|80.0%|4|1|5|
@@ -12,6 +12,8 @@ describe 'MarkdownFormatter' do
12
12
  let(:report_path) { File.join(temp_dir_path, 'report.md') }
13
13
  let(:expect_report) do
14
14
  root_directory = File.dirname(__FILE__)
15
+ project_name = SimpleCov.project_name
16
+ created_at = result.created_at
15
17
  erb_script = File.open(File.join(File.dirname(__FILE__), 'fixtures/report.md.erb')).read
16
18
  ERB.new(erb_script).result(binding)
17
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noritaka Horio