simplecov-console 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/lib/simplecov-console.rb +27 -11
- data/simplecov-console.gemspec +7 -7
- data/test/helper.rb +9 -19
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 290f9f7dda635d7301e3c4f2acd9bb81a17fda27aee5a812983ba19bfea11ebe
|
4
|
+
data.tar.gz: 2e317c4c10cf7dff407e2544c2916136c7d436f35a89fc10a509649a8706d32c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2de0c0d1e3b265df0d214368841200362feee6817497562d0ad04246b2c2ab81346e714242bd767bf8ffbe7fdca8d321061559a5a05a47a09fe2c79f14df91bd
|
7
|
+
data.tar.gz: 0d6bd990215178e64db73696dfa06454ba46d0f72771e380114d9c881e7945fc0e7c33dcc010b8c5b1b598eb4f4a2ad3cb39aff921c298446bc375306a66102f
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/lib/simplecov-console.rb
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
-
require '
|
1
|
+
require 'terminal-table'
|
2
2
|
require 'ansi/code'
|
3
3
|
|
4
4
|
class SimpleCov::Formatter::Console
|
5
5
|
|
6
|
-
VERSION =
|
6
|
+
VERSION = IO.read(File.expand_path("../../VERSION", __FILE__)).strip
|
7
7
|
|
8
|
-
ATTRIBUTES = [:table_options]
|
8
|
+
ATTRIBUTES = [:table_options, :use_colors]
|
9
9
|
class << self
|
10
10
|
attr_accessor(*ATTRIBUTES)
|
11
11
|
end
|
12
12
|
|
13
|
+
# enable colors unless NO_COLOR=1
|
14
|
+
SimpleCov::Formatter::Console.use_colors =
|
15
|
+
(ENV['NO_COLOR'].nil? or ENV['NO_COLOR'].empty?) ? true : false
|
16
|
+
|
13
17
|
def format(result)
|
14
18
|
|
15
19
|
root = nil
|
@@ -48,11 +52,13 @@ class SimpleCov::Formatter::Console
|
|
48
52
|
end
|
49
53
|
|
50
54
|
table = files.map do |f|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
[
|
56
|
+
colorize(pct(f)),
|
57
|
+
f.filename.gsub(root + "/", ''),
|
58
|
+
f.lines_of_code,
|
59
|
+
f.missed_lines.count,
|
60
|
+
missed(f.missed_lines).join(", ")
|
61
|
+
]
|
56
62
|
end
|
57
63
|
|
58
64
|
if table.size > 15 then
|
@@ -61,10 +67,14 @@ class SimpleCov::Formatter::Console
|
|
61
67
|
end
|
62
68
|
|
63
69
|
table_options = SimpleCov::Formatter::Console.table_options || {}
|
70
|
+
if !table_options.kind_of?(Hash) then
|
71
|
+
raise ArgumentError.new("SimpleCov::Formatter::Console.table_options must be a Hash")
|
72
|
+
end
|
73
|
+
headings = %w{ coverage file lines missed missing }
|
64
74
|
|
65
|
-
|
66
|
-
|
67
|
-
puts
|
75
|
+
opts = table_options.merge({:headings => headings, :rows => table})
|
76
|
+
t = Terminal::Table.new(opts)
|
77
|
+
puts t
|
68
78
|
|
69
79
|
if covered_files > 0 then
|
70
80
|
puts "#{covered_files} file(s) with 100% coverage not shown"
|
@@ -104,7 +114,13 @@ class SimpleCov::Formatter::Console
|
|
104
114
|
sprintf("%6.2f%%", obj.covered_percent)
|
105
115
|
end
|
106
116
|
|
117
|
+
def use_colors?
|
118
|
+
SimpleCov::Formatter::Console.use_colors
|
119
|
+
end
|
120
|
+
|
107
121
|
def colorize(s)
|
122
|
+
return s if !use_colors?
|
123
|
+
|
108
124
|
s =~ /([\d.]+)/
|
109
125
|
n = $1.to_f
|
110
126
|
if n >= 90 then
|
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.
|
5
|
+
# stub: simplecov-console 0.5.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "simplecov-console".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.5.0"
|
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 = "2019-05-24"
|
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 = [
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
]
|
33
33
|
s.homepage = "http://github.com/chetan/simplecov-console".freeze
|
34
34
|
s.licenses = ["MIT".freeze]
|
35
|
-
s.rubygems_version = "
|
35
|
+
s.rubygems_version = "3.0.2".freeze
|
36
36
|
s.summary = "Simple console output formatter".freeze
|
37
37
|
|
38
38
|
if s.respond_to? :specification_version then
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
|
41
41
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
42
42
|
s.add_runtime_dependency(%q<simplecov>.freeze, [">= 0"])
|
43
|
-
s.add_runtime_dependency(%q<
|
43
|
+
s.add_runtime_dependency(%q<terminal-table>.freeze, [">= 0"])
|
44
44
|
s.add_runtime_dependency(%q<ansi>.freeze, [">= 0"])
|
45
45
|
s.add_development_dependency(%q<minitest>.freeze, [">= 0"])
|
46
46
|
s.add_development_dependency(%q<yard>.freeze, [">= 0"])
|
@@ -48,7 +48,7 @@ Gem::Specification.new do |s|
|
|
48
48
|
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
49
49
|
else
|
50
50
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
51
|
-
s.add_dependency(%q<
|
51
|
+
s.add_dependency(%q<terminal-table>.freeze, [">= 0"])
|
52
52
|
s.add_dependency(%q<ansi>.freeze, [">= 0"])
|
53
53
|
s.add_dependency(%q<minitest>.freeze, [">= 0"])
|
54
54
|
s.add_dependency(%q<yard>.freeze, [">= 0"])
|
@@ -57,7 +57,7 @@ Gem::Specification.new do |s|
|
|
57
57
|
end
|
58
58
|
else
|
59
59
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
60
|
-
s.add_dependency(%q<
|
60
|
+
s.add_dependency(%q<terminal-table>.freeze, [">= 0"])
|
61
61
|
s.add_dependency(%q<ansi>.freeze, [">= 0"])
|
62
62
|
s.add_dependency(%q<minitest>.freeze, [">= 0"])
|
63
63
|
s.add_dependency(%q<yard>.freeze, [">= 0"])
|
data/test/helper.rb
CHANGED
@@ -1,25 +1,15 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require "simplecov"
|
11
|
-
require "minitest/autorun"
|
12
1
|
|
13
|
-
$LOAD_PATH.
|
14
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
15
|
-
require 'simplecov-console'
|
2
|
+
$LOAD_PATH.push(File.expand_path("../../lib", __FILE__))
|
16
3
|
|
17
|
-
|
18
|
-
|
4
|
+
require "bundler/setup"
|
5
|
+
require "simplecov"
|
6
|
+
require "simplecov-console"
|
19
7
|
|
20
|
-
SimpleCov.formatter = SimpleCov::Formatter::Console
|
21
8
|
SimpleCov.start do
|
22
|
-
|
9
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
10
|
+
SimpleCov::Formatter::HTMLFormatter,
|
11
|
+
SimpleCov::Formatter::Console
|
12
|
+
])
|
23
13
|
end
|
24
14
|
|
25
|
-
|
15
|
+
require "minitest/autorun"
|
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.
|
4
|
+
version: 0.5.0
|
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: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: terminal-table
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -145,8 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
|
149
|
-
rubygems_version: 2.6.8
|
148
|
+
rubygems_version: 3.0.2
|
150
149
|
signing_key:
|
151
150
|
specification_version: 4
|
152
151
|
summary: Simple console output formatter
|