checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
2
SHA1:
3
- metadata.gz: 661e5e9e3a45659eeb0beec94dec0d085b7a09d5
4
- data.tar.gz: 31d34cd1d397e3834c7a574fd5b83102345a9c31
3
+ metadata.gz: daa90cb61d7c7ba5f9900f2fc846e6aca739b1e5
4
+ data.tar.gz: eb6fcec1297e096d1f3c3bac183edf63b037c6aa
5
5
SHA512:
6
- metadata.gz: 13652f2b15e7bf8876e2351c132409e11127abd5561e49df314d26ce36ca0bda45815428d52a6919127834fab060d9da321c121be3dbe80a046aa99a31a5ae74
7
- data.tar.gz: 8eeaddb17962edfb7ff5a47593a14faf304b00fe52025925897f171faa4d4ca5367c2b287eeb2f7160b3ba42d325f2f4896ff33c6b82f9062fc07fd6ccb3055a
6
+ metadata.gz: 4aabde8dce86003b90a3335badd5d2d51f05a5a30155decbfe13d49f171df7d30f23a3adcb029103fb1f225586f82beb8a35a5940aa1a948d492ece7c2e825e4
7
+ data.tar.gz: 9199fdc36c3a169d69ba9492b4050333033bfed18245a2fd8605a59f6534c5d98d43379c3dcd59dff40d60076ebe0a9f18857f636fa613e4488ebadd5f8e4133
data/Gemfile CHANGED
@@ -2,11 +2,11 @@ source "http://rubygems.org"
2
2
3
3
gem "simplecov"
4
4
gem "hirb"
5
- gem "colorize"
5
+ gem "ansi"
6
6
7
7
group :development do
8
8
gem "minitest"
9
9
gem "yard"
10
10
gem "bundler", "~> 1.2"
11
- gem 'jeweler', :git => "https://github.com/chetan/jeweler.git", :branch => "bixby"
11
+ gem "jeweler", "~> 1.8"
12
12
end
data/README.md CHANGED
@@ -19,30 +19,29 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
19
19
20
20
Example output:
21
21
```
22
- COVERAGE: 68.89% -- 910/1321 lines
23
-
24
- showing bottom (worst) 15 of 65 files
25
- +----------+----------------------------------------------------+
26
- | coverage | file |
27
- +----------+----------------------------------------------------+
28
- | 16.67% | lib/bixby/modules/metrics/rescan.rb |
29
- | 20.93% | lib/bixby/modules/repository.rb |
30
- | 21.43% | app/controllers/monitoring/commands_controller.rb |
31
- | 22.73% | app/controllers/hosts_controller.rb |
32
- | 22.73% | app/controllers/monitoring/checks_controller.rb |
33
- | 25.00% | lib/rails_ext/migration.rb |
34
- | 25.00% | app/controllers/inventory/hosts_controller.rb |
35
- | 28.21% | lib/bixby/modules/monitoring.rb |
36
- | 30.00% | app/controllers/monitoring/metrics_controller.rb |
37
- | 30.77% | lib/rails_ext/to_api.rb |
38
- | 36.11% | app/controllers/application_controller.rb |
39
- | 40.00% | app/controllers/monitoring/resources_controller.rb |
40
- | 40.00% | app/controllers/monitoring/hosts_controller.rb |
41
- | 46.15% | lib/bixby/modules/notifier.rb |
42
- | 47.83% | lib/bixby/hooks.rb |
43
- +----------+----------------------------------------------------+
44
-
22
+ COVERAGE: 82.34% -- 2345/2848 lines in 111 files
23
+
24
+ showing bottom (worst) 15 of 69 files
25
+ +----------+--------------------------------------------+-------+--------+---------------------------------------------+
26
+ | coverage | file | lines | missed | missing |
27
+ +----------+--------------------------------------------+-------+--------+---------------------------------------------+
28
+ | 22.73% | lib/bixby/api/websocket_server.rb | 22 | 17 | 11, 14, 17-18, 20-22, 24, 28-30, 32, 36-... |
29
+ | 30.77% | app/models/role.rb | 13 | 9 | 28-34, 36-37 |
30
+ | 32.14% | lib/bixby/modules/metrics/rescan.rb | 28 | 19 | 19-23, 27-31, 33-37, 39-41, 43 |
31
+ | 42.86% | lib/archie/mail.rb | 14 | 8 | 6-8, 12-15, 22 |
32
+ | 44.00% | lib/archie/controller.rb | 50 | 28 | 18-21, 23, 27-30, 32, 38-40, 44-45, 48-4... |
33
+ | 44.44% | app/models/metric_info.rb | 9 | 5 | 38-40, 42, 44 |
34
+ | 46.15% | lib/bixby/modules/notifier.rb | 13 | 7 | 13-14, 27-28, 38-40 |
35
+ | 46.15% | lib/archie/otp/controller.rb | 26 | 14 | 15-18, 21, 26-27, 31, 33-34, 36-38, 41 |
36
+ | 46.88% | app/controllers/rest/models/hosts_contr... | 32 | 17 | 7, 19-22, 24, 28-30, 32, 36-38, 42-44, 48 |
37
+ | 47.83% | lib/bixby/hooks.rb | 46 | 24 | 54, 68-70, 72-74, 84-86, 88-90, 104, 111... |
38
+ | 48.28% | app/controllers/rest/models/checks_cont... | 29 | 15 | 5, 7-8, 10, 13, 34, 38-40, 44-45, 47, 49... |
39
+ | 48.44% | app/controllers/application_controller.rb | 64 | 33 | 19, 35-37, 57, 59-64, 67, 88, 92, 107, 1... |
40
+ | 50.00% | app/views/models/repo.rb | 12 | 6 | 10, 12-13, 16-17, 20 |
41
+ | 54.55% | lib/ext/sidekiq_logging.rb | 11 | 5 | 9, 15-17, 19 |
42
+ | 60.00% | app/views/models/check_template.rb | 10 | 4 | 10-13 |
43
+ +----------+--------------------------------------------+-------+--------+---------------------------------------------+
44
+ 42 file(s) with 100% coverage not shown
45
- URL: file:///.../coverage/index.html
46
45
```
47
46
48
47
@@ -58,5 +57,5 @@ URL: file:///.../coverage/index.html
58
57
59
58
### Copyright
60
59
61
- Copyright (c) 2012 Chetan Sarva. See LICENSE.txt for
60
+ Copyright (c) 2014 Chetan Sarva. See LICENSE.txt for
62
61
further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.3.0
data/lib/simplecov-console.rb CHANGED
@@ -1,6 +1,5 @@
1
-
2
1
require 'hirb'
3
- require 'colorize'
2
+ require 'ansi/code'
4
3
5
4
class SimpleCov::Formatter::Console
6
5
@@ -43,7 +42,13 @@ class SimpleCov::Formatter::Console
43
42
return
44
43
end
45
44
46
- table = files.map{ |f| { :file => f.filename.gsub(root + "/", ''), :coverage => pct(f) } }
45
+ table = files.map do |f|
46
+ { :coverage => pct(f),
47
+ :lines => f.lines_of_code,
48
+ :file => f.filename.gsub(root + "/", ''),
49
+ :missed => f.missed_lines.count,
50
+ :missing => missed(f.missed_lines).join(", ") }
51
+ end
47
52
48
53
if table.size > 15 then
49
54
puts "showing bottom (worst) 15 of #{table.size} files"
@@ -60,6 +65,34 @@ class SimpleCov::Formatter::Console
60
65
61
66
end
62
67
68
+ def missed(missed_lines)
69
+ groups = {}
70
+ base = nil
71
+ previous = nil
72
+ missed_lines.each do |src|
73
+ ln = src.line_number
74
+ if base && previous && (ln - 1) == previous
75
+ groups[base] += 1
76
+ previous = ln
77
+ else
78
+ base = ln
79
+ groups[base] = 0
80
+ previous = base
81
+ end
82
+ end
83
+
84
+ group_str = []
85
+ groups.map do |base, v|
86
+ if v > 0
87
+ group_str << "#{base}-#{base + v}"
88
+ else
89
+ group_str << "#{base}"
90
+ end
91
+ end
92
+
93
+ group_str
94
+ end
95
+
63
96
def pct(obj)
64
97
sprintf("%6.2f%%", obj.covered_percent)
65
98
end
@@ -68,11 +101,11 @@ class SimpleCov::Formatter::Console
68
101
s =~ /([\d.]+)/
69
102
n = $1.to_f
70
103
if n >= 90 then
71
- s.colorize(:green)
104
+ ANSI.green { s }
72
105
elsif n >= 80 then
73
- s.colorize(:yellow)
106
+ ANSI.yellow { s }
74
107
else
75
- s.colorize(:red)
108
+ ANSI.red { s }
76
109
end
77
110
end
78
111
data/simplecov-console.gemspec CHANGED
@@ -2,15 +2,16 @@
2
2
# DO NOT EDIT THIS FILE DIRECTLY
3
3
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
# -*- encoding: utf-8 -*-
5
- # stub: simplecov-console 0.1.3 ruby lib
5
+ # stub: simplecov-console 0.3.0 ruby lib
6
6
7
7
Gem::Specification.new do |s|
8
8
s.name = "simplecov-console"
9
- s.version = "0.1.3"
9
+ s.version = "0.3.0"
10
10
11
11
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
12
13
s.authors = ["Chetan Sarva"]
13
- s.date = "2013-10-04"
14
+ s.date = "2016-01-08"
14
15
s.description = "Simple console output formatter for SimpleCov"
15
16
s.email = "chetan@pixelcop.net"
16
17
s.extra_rdoc_files = [
@@ -31,8 +32,7 @@ Gem::Specification.new do |s|
31
32
]
32
33
s.homepage = "http://github.com/chetan/simplecov-console"
33
34
s.licenses = ["MIT"]
34
- s.require_paths = ["lib"]
35
+ s.rubygems_version = "2.4.5.1"
35
- s.rubygems_version = "2.1.5"
36
36
s.summary = "Simple console output formatter"
37
37
38
38
if s.respond_to? :specification_version then
@@ -41,28 +41,28 @@ Gem::Specification.new do |s|
41
41
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
42
42
s.add_runtime_dependency(%q<simplecov>, [">= 0"])
43
43
s.add_runtime_dependency(%q<hirb>, [">= 0"])
44
- s.add_runtime_dependency(%q<colorize>, [">= 0"])
44
+ s.add_runtime_dependency(%q<ansi>, [">= 0"])
45
45
s.add_development_dependency(%q<minitest>, [">= 0"])
46
46
s.add_development_dependency(%q<yard>, [">= 0"])
47
47
s.add_development_dependency(%q<bundler>, ["~> 1.2"])
48
- s.add_development_dependency(%q<jeweler>, [">= 0"])
48
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8"])
49
49
else
50
50
s.add_dependency(%q<simplecov>, [">= 0"])
51
51
s.add_dependency(%q<hirb>, [">= 0"])
52
- s.add_dependency(%q<colorize>, [">= 0"])
52
+ s.add_dependency(%q<ansi>, [">= 0"])
53
53
s.add_dependency(%q<minitest>, [">= 0"])
54
54
s.add_dependency(%q<yard>, [">= 0"])
55
55
s.add_dependency(%q<bundler>, ["~> 1.2"])
56
- s.add_dependency(%q<jeweler>, [">= 0"])
56
+ s.add_dependency(%q<jeweler>, ["~> 1.8"])
57
57
end
58
58
else
59
59
s.add_dependency(%q<simplecov>, [">= 0"])
60
60
s.add_dependency(%q<hirb>, [">= 0"])
61
- s.add_dependency(%q<colorize>, [">= 0"])
61
+ s.add_dependency(%q<ansi>, [">= 0"])
62
62
s.add_dependency(%q<minitest>, [">= 0"])
63
63
s.add_dependency(%q<yard>, [">= 0"])
64
64
s.add_dependency(%q<bundler>, ["~> 1.2"])
65
- s.add_dependency(%q<jeweler>, [">= 0"])
65
+ s.add_dependency(%q<jeweler>, ["~> 1.8"])
66
66
end
67
67
end
68
68
data/test/helper.rb CHANGED
@@ -8,13 +8,13 @@ rescue Bundler::BundlerError => e
8
8
exit e.status_code
9
9
end
10
10
require "simplecov"
11
- require 'minitest/unit'
11
+ require "minitest/autorun"
12
12
13
13
$LOAD_PATH.unshift(File.dirname(__FILE__))
14
14
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
15
15
require 'simplecov-console'
16
16
17
- class MiniTest::Unit::TestCase
17
+ class MiniTest::Test
18
18
end
19
19
20
20
SimpleCov.formatter = SimpleCov::Formatter::Console
@@ -22,4 +22,4 @@ SimpleCov.start do
22
22
add_filter "/test/"
23
23
end
24
24
25
- MiniTest::Unit.autorun
25
+ MiniTest.autorun
data/test/test_simplecov-console.rb CHANGED
@@ -1,8 +1,22 @@
1
1
require 'helper'
2
2
3
- class TestSimplecovConsole < MiniTest::Unit::TestCase
3
+ class TestSimplecovConsole < MiniTest::Test
4
+
5
+ Source = Struct.new(:line_number)
6
+
7
+ def setup
8
+ @console = SimpleCov::Formatter::Console.new
9
+ end
10
+
4
11
def test_defined
5
12
assert defined?(SimpleCov::Formatter::Console)
6
13
assert defined?(SimpleCov::Formatter::Console::VERSION)
7
14
end
15
+
16
+ def test_missed
17
+ missed_lines = [Source.new(1), Source.new(2),
18
+ Source.new(3), Source.new(5)]
19
+ expected_result = ["1-3", "5"]
20
+ assert_equal @console.missed(missed_lines), expected_result
21
+ end
8
22
end
metadata CHANGED
@@ -1,113 +1,113 @@
1
1
--- !ruby/object:Gem::Specification
2
2
name: simplecov-console
3
3
version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.3.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: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
12
dependencies:
13
13
- !ruby/object:Gem::Dependency
14
14
name: simplecov
15
15
requirement: !ruby/object:Gem::Requirement
16
16
requirements:
17
- - - '>='
17
+ - - ">="
18
18
- !ruby/object:Gem::Version
19
19
version: '0'
20
20
type: :runtime
21
21
prerelease: false
22
22
version_requirements: !ruby/object:Gem::Requirement
23
23
requirements:
24
- - - '>='
24
+ - - ">="
25
25
- !ruby/object:Gem::Version
26
26
version: '0'
27
27
- !ruby/object:Gem::Dependency
28
28
name: hirb
29
29
requirement: !ruby/object:Gem::Requirement
30
30
requirements:
31
- - - '>='
31
+ - - ">="
32
32
- !ruby/object:Gem::Version
33
33
version: '0'
34
34
type: :runtime
35
35
prerelease: false
36
36
version_requirements: !ruby/object:Gem::Requirement
37
37
requirements:
38
- - - '>='
38
+ - - ">="
39
39
- !ruby/object:Gem::Version
40
40
version: '0'
41
41
- !ruby/object:Gem::Dependency
42
- name: colorize
42
+ name: ansi
43
43
requirement: !ruby/object:Gem::Requirement
44
44
requirements:
45
- - - '>='
45
+ - - ">="
46
46
- !ruby/object:Gem::Version
47
47
version: '0'
48
48
type: :runtime
49
49
prerelease: false
50
50
version_requirements: !ruby/object:Gem::Requirement
51
51
requirements:
52
- - - '>='
52
+ - - ">="
53
53
- !ruby/object:Gem::Version
54
54
version: '0'
55
55
- !ruby/object:Gem::Dependency
56
56
name: minitest
57
57
requirement: !ruby/object:Gem::Requirement
58
58
requirements:
59
- - - '>='
59
+ - - ">="
60
60
- !ruby/object:Gem::Version
61
61
version: '0'
62
62
type: :development
63
63
prerelease: false
64
64
version_requirements: !ruby/object:Gem::Requirement
65
65
requirements:
66
- - - '>='
66
+ - - ">="
67
67
- !ruby/object:Gem::Version
68
68
version: '0'
69
69
- !ruby/object:Gem::Dependency
70
70
name: yard
71
71
requirement: !ruby/object:Gem::Requirement
72
72
requirements:
73
- - - '>='
73
+ - - ">="
74
74
- !ruby/object:Gem::Version
75
75
version: '0'
76
76
type: :development
77
77
prerelease: false
78
78
version_requirements: !ruby/object:Gem::Requirement
79
79
requirements:
80
- - - '>='
80
+ - - ">="
81
81
- !ruby/object:Gem::Version
82
82
version: '0'
83
83
- !ruby/object:Gem::Dependency
84
84
name: bundler
85
85
requirement: !ruby/object:Gem::Requirement
86
86
requirements:
87
- - - ~>
87
+ - - "~>"
88
88
- !ruby/object:Gem::Version
89
89
version: '1.2'
90
90
type: :development
91
91
prerelease: false
92
92
version_requirements: !ruby/object:Gem::Requirement
93
93
requirements:
94
- - - ~>
94
+ - - "~>"
95
95
- !ruby/object:Gem::Version
96
96
version: '1.2'
97
97
- !ruby/object:Gem::Dependency
98
98
name: jeweler
99
99
requirement: !ruby/object:Gem::Requirement
100
100
requirements:
101
- - - '>='
101
+ - - "~>"
102
102
- !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '1.8'
104
104
type: :development
105
105
prerelease: false
106
106
version_requirements: !ruby/object:Gem::Requirement
107
107
requirements:
108
- - - '>='
108
+ - - "~>"
109
109
- !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '1.8'
111
111
description: Simple console output formatter for SimpleCov
112
112
email: chetan@pixelcop.net
113
113
executables: []
@@ -116,7 +116,7 @@ extra_rdoc_files:
116
116
- LICENSE.txt
117
117
- README.md
118
118
files:
119
- - .document
119
+ - ".document"
120
120
- Gemfile
121
121
- LICENSE.txt
122
122
- README.md
@@ -136,17 +136,17 @@ require_paths:
136
136
- lib
137
137
required_ruby_version: !ruby/object:Gem::Requirement
138
138
requirements:
139
- - - '>='
139
+ - - ">="
140
140
- !ruby/object:Gem::Version
141
141
version: '0'
142
142
required_rubygems_version: !ruby/object:Gem::Requirement
143
143
requirements:
144
- - - '>='
144
+ - - ">="
145
145
- !ruby/object:Gem::Version
146
146
version: '0'
147
147
requirements: []
148
148
rubyforge_project:
149
- rubygems_version: 2.1.5
149
+ rubygems_version: 2.4.5.1
150
150
signing_key:
151
151
specification_version: 4
152
152
summary: Simple console output formatter