simplecov-console 0.9.2 → 0.9.3
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 +4 -4
- data/README.md +12 -0
- data/VERSION +1 -1
- data/lib/simplecov-console.rb +22 -2
- data/simplecov-console.gemspec +24 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b22892d93da49c959fa9cb9bc6346372a08e4e13e73860729c421e0b65459a74
|
4
|
+
data.tar.gz: 5e954e6c6d52382cbe7cc46fffa861f3aa6418556fbfe7ef8b23b26b7aa40d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30c45a645cc20b90fc4454febe88629a969bc2f2b8ad1c1593c08b3a520b499eaa0ec87a318513fd06aefdbe94f01db4224a89af85070b3566809c113d22b73
|
7
|
+
data.tar.gz: 634cc784def1616395f89aa7d605d5780f33c2c986970d163482f26a0bc85bd0c7b0545d104c3c41447dd20c38f8a012a0b6719159e9d5e0a695f21b33ec93b6
|
data/README.md
CHANGED
@@ -60,6 +60,8 @@ SimpleCov::Formatter::Console.max_lines = 5 # integer
|
|
60
60
|
SimpleCov::Formatter::Console.missing_len = 20 # integer
|
61
61
|
SimpleCov::Formatter::Console.output_style = 'block' # 'table' (default) or 'block'
|
62
62
|
SimpleCov::Formatter::Console.table_options = {:style => {:width => 200}}
|
63
|
+
SimpleCov::Formatter::Console.output_to_file = false
|
64
|
+
SimpleCov::Formatter::Console.output_filename = 'results.txt'
|
63
65
|
```
|
64
66
|
|
65
67
|
Note that all options except `table_options` can also be set via env var using
|
@@ -130,6 +132,16 @@ increasing the table width:
|
|
130
132
|
SimpleCov::Formatter::Console.table_options = {:style => {:width => 200}}
|
131
133
|
```
|
132
134
|
|
135
|
+
#### Output to File and filename
|
136
|
+
|
137
|
+
Saves the results to a file defaulted as 'results.txt' (customisable with the `output_filename` option) in the coverage folder.
|
138
|
+
Default is false to match existing functionality
|
139
|
+
|
140
|
+
```ruby
|
141
|
+
SimpleCov::Formatter::Console.output_to_file = true
|
142
|
+
SimpleCov::Formatter::Console.output_filename = 'my_coverage.txt'
|
143
|
+
```
|
144
|
+
|
133
145
|
#### Block output style
|
134
146
|
|
135
147
|
As an alternative to the default table output format, a simpler block format is
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.3
|
data/lib/simplecov-console.rb
CHANGED
@@ -5,7 +5,7 @@ class SimpleCov::Formatter::Console
|
|
5
5
|
VERSION = IO.read(File.expand_path("../../VERSION", __FILE__)).strip
|
6
6
|
|
7
7
|
ATTRIBUTES = [:table_options, :use_colors, :max_rows, :max_lines,
|
8
|
-
:missing_len, :show_covered, :sort, :output_style]
|
8
|
+
:missing_len, :show_covered, :sort, :output_style, :output_to_file, :output_filename]
|
9
9
|
|
10
10
|
class << self
|
11
11
|
attr_accessor(*ATTRIBUTES)
|
@@ -31,6 +31,12 @@ class SimpleCov::Formatter::Console
|
|
31
31
|
# configure output format ('table', 'block')
|
32
32
|
SimpleCov::Formatter::Console.output_style = ENV.fetch('OUTPUT_STYLE', 'table')
|
33
33
|
|
34
|
+
# change output to a file
|
35
|
+
SimpleCov::Formatter::Console.output_to_file = ENV.fetch('SIMPLECOV_OUTPUT_TO_FILE', false)
|
36
|
+
|
37
|
+
# Related to above setting to change the filename
|
38
|
+
SimpleCov::Formatter::Console.output_filename = ENV.fetch('SIMPLECOV_OUTPUT_FILENAME', 'results.txt')
|
39
|
+
|
34
40
|
def include_output_style
|
35
41
|
if SimpleCov::Formatter::Console.output_style == 'block' then
|
36
42
|
require 'simplecov-console/output/block'
|
@@ -61,7 +67,15 @@ class SimpleCov::Formatter::Console
|
|
61
67
|
root = Dir.pwd
|
62
68
|
end
|
63
69
|
|
64
|
-
|
70
|
+
result_file_path = ''
|
71
|
+
if SimpleCov::Formatter::Console.output_to_file
|
72
|
+
result_file_path = File.join(SimpleCov.coverage_path, SimpleCov::Formatter::Console.output_filename)
|
73
|
+
# Temporarily assign $stdout to the file
|
74
|
+
file = File.open(result_file_path, 'w')
|
75
|
+
$stdout = file
|
76
|
+
end
|
77
|
+
|
78
|
+
puts unless SimpleCov::Formatter::Console.output_to_file
|
65
79
|
puts "COVERAGE: #{colorize(pct(result.covered_percent))} -- #{result.covered_lines}/#{result.total_lines} lines in #{result.files.size} files"
|
66
80
|
show_branch_coverage = show_branch_coverage?(result)
|
67
81
|
if show_branch_coverage
|
@@ -115,6 +129,12 @@ class SimpleCov::Formatter::Console
|
|
115
129
|
puts "#{covered_files} file(s) with 100% coverage not shown"
|
116
130
|
end
|
117
131
|
|
132
|
+
if SimpleCov::Formatter::Console.output_to_file
|
133
|
+
# Restore $stdout to its original state
|
134
|
+
$stdout = STDOUT
|
135
|
+
file.close
|
136
|
+
puts "Coverage report generated for #{result.command_name} to #{result_file_path}"
|
137
|
+
end
|
118
138
|
end
|
119
139
|
|
120
140
|
def branches_missed(missed_branches)
|
data/simplecov-console.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: simplecov-console 0.9.
|
5
|
+
# stub: simplecov-console 0.9.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "simplecov-console".freeze
|
9
|
-
s.version = "0.9.
|
9
|
+
s.version = "0.9.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Chetan Sarva".freeze]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2025-02-18"
|
15
15
|
s.description = "Simple console output formatter for SimpleCov".freeze
|
16
16
|
s.email = "chetan@pixelcop.net".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -36,17 +36,29 @@ Gem::Specification.new do |s|
|
|
36
36
|
]
|
37
37
|
s.homepage = "http://github.com/chetan/simplecov-console".freeze
|
38
38
|
s.licenses = ["MIT".freeze]
|
39
|
-
s.rubygems_version = "3.
|
39
|
+
s.rubygems_version = "3.3.26".freeze
|
40
40
|
s.summary = "Simple console output formatter".freeze
|
41
41
|
|
42
|
-
s.specification_version
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
s.specification_version = 4
|
44
|
+
end
|
43
45
|
|
44
|
-
s.add_runtime_dependency
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
if s.respond_to? :add_runtime_dependency then
|
47
|
+
s.add_runtime_dependency(%q<simplecov>.freeze, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<terminal-table>.freeze, [">= 0"])
|
49
|
+
s.add_runtime_dependency(%q<ansi>.freeze, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<minitest>.freeze, [">= 0"])
|
51
|
+
s.add_development_dependency(%q<yard>.freeze, [">= 0"])
|
52
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 2.1"])
|
53
|
+
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
56
|
+
s.add_dependency(%q<terminal-table>.freeze, [">= 0"])
|
57
|
+
s.add_dependency(%q<ansi>.freeze, [">= 0"])
|
58
|
+
s.add_dependency(%q<minitest>.freeze, [">= 0"])
|
59
|
+
s.add_dependency(%q<yard>.freeze, [">= 0"])
|
60
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 2.1"])
|
61
|
+
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
62
|
+
end
|
51
63
|
end
|
52
64
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chetan Sarva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.3.26
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Simple console output formatter
|