simplecov-console 0.1.3 → 0.2.0

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: 661e5e9e3a45659eeb0beec94dec0d085b7a09d5
4
- data.tar.gz: 31d34cd1d397e3834c7a574fd5b83102345a9c31
3
+ metadata.gz: fbb0af4d90b61d8cb27c15c07cae1935cd8f4416
4
+ data.tar.gz: 96753132f4deb5d039e1c1cef1ad4c6fd9251d6a
5
5
  SHA512:
6
- metadata.gz: 13652f2b15e7bf8876e2351c132409e11127abd5561e49df314d26ce36ca0bda45815428d52a6919127834fab060d9da321c121be3dbe80a046aa99a31a5ae74
7
- data.tar.gz: 8eeaddb17962edfb7ff5a47593a14faf304b00fe52025925897f171faa4d4ca5367c2b287eeb2f7160b3ba42d325f2f4896ff33c6b82f9062fc07fd6ccb3055a
6
+ metadata.gz: a52f26eb24533cf325a56977d459474399efef2daf386059a89957937a55dacef4d079b96395fb5e39bd760b05695bc703175c9a42cd28da8e6c9caf41dec245
7
+ data.tar.gz: 97df6e89e4efafeb5a3813d852892cbb3e7d8581a3890a5a42354a342f3663b8d5bd95954b20535eea9be8a48c56f1acb235e73986e9f069b7cc8ee5bff5372b
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
-
45
- URL: file:///.../coverage/index.html
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
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.2.0
@@ -43,7 +43,13 @@ class SimpleCov::Formatter::Console
43
43
  return
44
44
  end
45
45
 
46
- table = files.map{ |f| { :file => f.filename.gsub(root + "/", ''), :coverage => pct(f) } }
46
+ table = files.map do |f|
47
+ { :coverage => pct(f),
48
+ :lines => f.lines_of_code,
49
+ :file => f.filename.gsub(root + "/", ''),
50
+ :missed => f.missed_lines.count,
51
+ :missing => missed(f.missed_lines).join(", ") }
52
+ end
47
53
 
48
54
  if table.size > 15 then
49
55
  puts "showing bottom (worst) 15 of #{table.size} files"
@@ -60,6 +66,34 @@ class SimpleCov::Formatter::Console
60
66
 
61
67
  end
62
68
 
69
+ def missed(missed_lines)
70
+ groups = {}
71
+ base = nil
72
+ previous = nil
73
+ missed_lines.each do |src|
74
+ ln = src.line_number
75
+ if base && previous && (ln - 1) == previous
76
+ groups[base] += 1
77
+ previous = ln
78
+ else
79
+ base = ln
80
+ groups[base] = 0
81
+ previous = base
82
+ end
83
+ end
84
+
85
+ group_str = []
86
+ groups.map do |base, v|
87
+ if v > 0
88
+ group_str << "#{base}-#{base + v}"
89
+ else
90
+ group_str << "#{base}"
91
+ end
92
+ end
93
+
94
+ group_str
95
+ end
96
+
63
97
  def pct(obj)
64
98
  sprintf("%6.2f%%", obj.covered_percent)
65
99
  end
@@ -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.2.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.2.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 = "2014-09-04"
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.1.5"
35
+ s.rubygems_version = "2.2.2"
36
36
  s.summary = "Simple console output formatter"
37
37
 
38
38
  if s.respond_to? :specification_version then
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
@@ -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,111 +1,111 @@
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.2.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: 2014-09-04 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
42
  name: colorize
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
103
  version: '0'
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
110
  version: '0'
111
111
  description: Simple console output formatter for SimpleCov
@@ -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.2.2
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: Simple console output formatter