coverband 4.2.2 → 4.2.3.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/coverband/adapters/hash_redis_store.rb +2 -1
- data/lib/coverband/collectors/view_tracker.rb +32 -8
- data/lib/coverband/configuration.rb +5 -0
- data/lib/coverband/reporters/web.rb +32 -1
- data/lib/coverband/utils/result.rb +5 -2
- data/lib/coverband/utils/source_file.rb +3 -0
- data/lib/coverband/version.rb +1 -1
- data/public/application.css +8 -0
- data/test/coverband/adapters/hash_redis_store_test.rb +4 -0
- data/test/coverband/adapters/redis_store_test.rb +6 -1
- data/test/coverband/collectors/view_tracker_test.rb +23 -7
- data/test/coverband/reporters/html_test.rb +13 -0
- data/test/coverband/utils/source_file_test.rb +4 -0
- data/views/file_list.erb +2 -1
- data/views/nav.erb +1 -1
- data/views/source_file.erb +7 -0
- data/views/view_tracker.erb +15 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9f8a71fc670b19d665c9234dec871025649f29f958a5cc853992a2d3e05d95a
|
4
|
+
data.tar.gz: 210bd1569609d05d4d480152d64ae00cfcc3a233473f13d61192207b584d8314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49e039fe18d8c049524b807af2e0005d7857cc550b65c61f1814ea2fdd64b304c2d5eeb7b6b653622054b338985bec217b245b87bbf6b8139d590609f977a980
|
7
|
+
data.tar.gz: 4985b01cb295f64dbee3543fc721e445d9066d956a71966672185eabc6ae87549ce893993dfef3dc142775836aef2b0102f10eb234fa564a0067049376a6b331
|
data/Rakefile
CHANGED
@@ -104,7 +104,8 @@ module Coverband
|
|
104
104
|
|
105
105
|
data = coverage_data_from_redis(data_from_redis)
|
106
106
|
hash[file] = data_from_redis.select { |meta_data_key, _value| META_DATA_KEYS.include?(meta_data_key) }.merge!('data' => data)
|
107
|
-
hash[file]
|
107
|
+
hash[file][LAST_UPDATED_KEY] = hash[file][LAST_UPDATED_KEY].blank? ? nil : hash[file][LAST_UPDATED_KEY].to_i
|
108
|
+
hash[file].merge!(LAST_UPDATED_KEY => hash[file][LAST_UPDATED_KEY], FIRST_UPDATED_KEY => hash[file][FIRST_UPDATED_KEY].to_i)
|
108
109
|
end
|
109
110
|
|
110
111
|
def coverage_data_from_redis(data_from_redis)
|
@@ -7,7 +7,8 @@ module Coverband
|
|
7
7
|
###
|
8
8
|
# This class tracks view file usage via ActiveSupport::Notifications
|
9
9
|
#
|
10
|
-
# This is a port of Flatfoot, a project I open sourced years ago,
|
10
|
+
# This is a port of Flatfoot, a project I open sourced years ago,
|
11
|
+
# but am now rolling into Coverband
|
11
12
|
# https://github.com/livingsocial/flatfoot
|
12
13
|
#
|
13
14
|
# TODO: test and ensure slim, haml, and other support
|
@@ -31,6 +32,7 @@ module Coverband
|
|
31
32
|
|
32
33
|
@logged_views = []
|
33
34
|
@views_to_record = []
|
35
|
+
redis_store.set(tracker_time_key, Time.now.to_i) unless redis_store.exists(tracker_time_key)
|
34
36
|
end
|
35
37
|
|
36
38
|
###
|
@@ -59,26 +61,43 @@ module Coverband
|
|
59
61
|
end
|
60
62
|
|
61
63
|
def used_views
|
62
|
-
views = redis_store.
|
63
|
-
normalized_views =
|
64
|
-
views.
|
64
|
+
views = redis_store.hgetall(tracker_key)
|
65
|
+
normalized_views = {}
|
66
|
+
views.each_pair do |view, time|
|
65
67
|
roots.each do |root|
|
66
68
|
view = view.gsub(/#{root}/, '')
|
67
69
|
end
|
68
|
-
normalized_views
|
70
|
+
normalized_views[view] = time
|
69
71
|
end
|
70
72
|
normalized_views
|
71
73
|
end
|
72
74
|
|
73
75
|
def unused_views
|
74
|
-
recently_used_views = used_views
|
76
|
+
recently_used_views = used_views.keys
|
75
77
|
all_views = target.reject { |view| recently_used_views.include?(view) }
|
76
78
|
# since layouts don't include format we count them used if they match with ANY formats
|
77
79
|
all_views.reject { |view| view.match(/\/layouts\//) && recently_used_views.any? { |used_view| view.include?(used_view) } }
|
78
80
|
end
|
79
81
|
|
82
|
+
def tracking_since
|
83
|
+
if (tracking_time = redis_store.get(tracker_time_key))
|
84
|
+
Time.at(tracking_time.to_i).iso8601
|
85
|
+
else
|
86
|
+
'N/A'
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
80
90
|
def reset_recordings
|
81
91
|
redis_store.del(tracker_key)
|
92
|
+
redis_store.del(tracker_time_key)
|
93
|
+
end
|
94
|
+
|
95
|
+
def clear_file!(filename)
|
96
|
+
return unless filename
|
97
|
+
|
98
|
+
filename = "#{@project_directory}/#{filename}"
|
99
|
+
redis_store.hdel(tracker_key, filename)
|
100
|
+
logged_views.delete(filename)
|
82
101
|
end
|
83
102
|
|
84
103
|
def self.supported_version?
|
@@ -86,8 +105,9 @@ module Coverband
|
|
86
105
|
end
|
87
106
|
|
88
107
|
def report_views_tracked
|
108
|
+
reported_time = Time.now.to_i
|
89
109
|
views_to_record.each do |file|
|
90
|
-
redis_store.
|
110
|
+
redis_store.hset(tracker_key, file, reported_time)
|
91
111
|
end
|
92
112
|
self.views_to_record = []
|
93
113
|
rescue StandardError => e
|
@@ -117,7 +137,11 @@ module Coverband
|
|
117
137
|
end
|
118
138
|
|
119
139
|
def tracker_key
|
120
|
-
'
|
140
|
+
'render_tracker_2'
|
141
|
+
end
|
142
|
+
|
143
|
+
def tracker_time_key
|
144
|
+
'render_tracker_time'
|
121
145
|
end
|
122
146
|
end
|
123
147
|
end
|
@@ -109,6 +109,11 @@ module Coverband
|
|
109
109
|
def store=(store)
|
110
110
|
raise 'Pass in an instance of Coverband::Adapters' unless store.is_a?(Coverband::Adapters::Base)
|
111
111
|
|
112
|
+
# Default to 5 minutes if using the hash redis store
|
113
|
+
# This is a safer default for the high server volumes that need the hash store
|
114
|
+
# it should avoid overloading the redis with lots of load
|
115
|
+
@background_reporting_sleep_seconds = 300 if store.is_a?(Coverband::Adapters::HashRedisStore)
|
116
|
+
|
112
117
|
@store = store
|
113
118
|
end
|
114
119
|
|
@@ -34,6 +34,10 @@ module Coverband
|
|
34
34
|
|
35
35
|
if request.post?
|
36
36
|
case request.path_info
|
37
|
+
when %r{\/clear_view_tracking_file}
|
38
|
+
clear_view_tracking_file
|
39
|
+
when %r{\/clear_view_tracking}
|
40
|
+
clear_view_tracking
|
37
41
|
when %r{\/clear_file}
|
38
42
|
clear_file
|
39
43
|
when %r{\/clear}
|
@@ -76,7 +80,11 @@ module Coverband
|
|
76
80
|
end
|
77
81
|
|
78
82
|
def view_tracker
|
79
|
-
|
83
|
+
notice = "<strong>Notice:</strong> #{Rack::Utils.escape_html(request.params['notice'])}<br/>"
|
84
|
+
notice = request.params['notice'] ? notice : ''
|
85
|
+
Coverband::Utils::HTMLFormatter.new(nil,
|
86
|
+
notice: notice,
|
87
|
+
base_path: base_path).format_view_tracker!
|
80
88
|
end
|
81
89
|
|
82
90
|
def debug_data
|
@@ -112,6 +120,29 @@ module Coverband
|
|
112
120
|
[301, { 'Location' => "#{base_path}?notice=#{notice}" }, []]
|
113
121
|
end
|
114
122
|
|
123
|
+
def clear_view_tracking
|
124
|
+
if Coverband.configuration.web_enable_clear
|
125
|
+
tracker = Coverband::Collectors::ViewTracker.new(store: Coverband.configuration.store)
|
126
|
+
tracker.reset_recordings
|
127
|
+
notice = 'view tracking reset'
|
128
|
+
else
|
129
|
+
notice = 'web_enable_clear isnt enabled in your configuration'
|
130
|
+
end
|
131
|
+
[301, { 'Location' => "#{base_path}/view_tracker?notice=#{notice}" }, []]
|
132
|
+
end
|
133
|
+
|
134
|
+
def clear_view_tracking_file
|
135
|
+
if Coverband.configuration.web_enable_clear
|
136
|
+
tracker = Coverband::Collectors::ViewTracker.new(store: Coverband.configuration.store)
|
137
|
+
filename = request.params['filename']
|
138
|
+
tracker.clear_file!(filename)
|
139
|
+
notice = "coverage for file #{filename} cleared"
|
140
|
+
else
|
141
|
+
notice = 'web_enable_clear isnt enabled in your configuration'
|
142
|
+
end
|
143
|
+
[301, { 'Location' => "#{base_path}/view_tracker?notice=#{notice}" }, []]
|
144
|
+
end
|
145
|
+
|
115
146
|
private
|
116
147
|
|
117
148
|
# This method should get the root mounted endpoint
|
@@ -55,11 +55,14 @@ module Coverband
|
|
55
55
|
# the line-by-line coverage to zero (if relevant) or nil (comments / whitespace etc).
|
56
56
|
def self.add_not_loaded_files(result, tracked_files)
|
57
57
|
if tracked_files
|
58
|
+
# TODO: Can we get rid of this dup it wastes memory
|
58
59
|
result = result.dup
|
59
60
|
Dir[tracked_files].each do |file|
|
60
61
|
absolute = File.expand_path(file)
|
61
|
-
|
62
|
-
|
62
|
+
result[absolute] ||= {
|
63
|
+
'data' => Array.new(File.foreach(absolute).count) { 0 },
|
64
|
+
'never_loaded' => true
|
65
|
+
}
|
63
66
|
end
|
64
67
|
end
|
65
68
|
|
@@ -87,6 +87,8 @@ module Coverband
|
|
87
87
|
attr_reader :first_updated_at
|
88
88
|
# the date this version of the file last saw any coverage activity
|
89
89
|
attr_reader :last_updated_at
|
90
|
+
# meta data that the file was never loaded during boot or runtime
|
91
|
+
attr_reader :never_loaded
|
90
92
|
NOT_AVAILABLE = 'not available'
|
91
93
|
|
92
94
|
def initialize(filename, file_data)
|
@@ -97,6 +99,7 @@ module Coverband
|
|
97
99
|
@first_updated_at = @last_updated_at = NOT_AVAILABLE
|
98
100
|
@first_updated_at = Time.at(file_data['first_updated_at']) if file_data['first_updated_at']
|
99
101
|
@last_updated_at = Time.at(file_data['last_updated_at']) if file_data['last_updated_at']
|
102
|
+
@never_loaded = file_data['never_loaded'] || false
|
100
103
|
else
|
101
104
|
# TODO: Deprecate this code path this was backwards compatability from 3-4
|
102
105
|
@coverage = file_data
|
data/lib/coverband/version.rb
CHANGED
data/public/application.css
CHANGED
@@ -687,6 +687,10 @@ a.src_link {
|
|
687
687
|
background: url("./magnify.png") no-repeat left 50%;
|
688
688
|
padding-left: 18px; }
|
689
689
|
|
690
|
+
.red a.src_link {
|
691
|
+
color: #990000;
|
692
|
+
}
|
693
|
+
|
690
694
|
tr, td {
|
691
695
|
margin: 0;
|
692
696
|
padding: 0; }
|
@@ -784,6 +788,10 @@ td {
|
|
784
788
|
display: inline-block;
|
785
789
|
}
|
786
790
|
|
791
|
+
.last_seen_at {
|
792
|
+
font-size: 8px;
|
793
|
+
}
|
794
|
+
|
787
795
|
.notice {
|
788
796
|
color: #856404;
|
789
797
|
background-color: #fff3cd;
|
@@ -134,13 +134,17 @@ class HashRedisStoreTest < Minitest::Test
|
|
134
134
|
@store.save_report(data)
|
135
135
|
assert_equal 1, @store.coverage.length
|
136
136
|
assert_equal [0, nil, 1, 2], @store.coverage['./dog.rb']['data']
|
137
|
+
# eager_loading doesn't set last_updated_at
|
138
|
+
assert_nil @store.coverage['./dog.rb']['last_updated_at']
|
137
139
|
@store.type = Coverband::RUNTIME_TYPE
|
138
140
|
data = {
|
139
141
|
'app_path/cat.rb' => [1, 2, 0, 1, 5]
|
140
142
|
}
|
143
|
+
current_time = Time.now.to_i
|
141
144
|
@store.save_report(data)
|
142
145
|
assert_equal 1, @store.coverage.length
|
143
146
|
assert_equal [1, 2, 0, 1, 5], @store.coverage['./cat.rb']['data']
|
147
|
+
assert current_time <= @store.coverage['./cat.rb']['last_updated_at']
|
144
148
|
end
|
145
149
|
|
146
150
|
def test_coverage_type
|
@@ -33,8 +33,10 @@ unless ENV['COVERBAND_HASH_REDIS_STORE']
|
|
33
33
|
@store.coverage.each_pair do |key, data|
|
34
34
|
assert_equal expected[key], data['data']
|
35
35
|
end
|
36
|
+
current_time = Time.now.to_i
|
36
37
|
@store.save_report(basic_coverage.dup)
|
37
38
|
assert_equal [0, 2, 4], @store.coverage['app_path/dog.rb']['data']
|
39
|
+
assert current_time <= @store.coverage['app_path/dog.rb']['last_updated_at']
|
38
40
|
end
|
39
41
|
|
40
42
|
def test_store_coverage_by_type
|
@@ -46,7 +48,6 @@ unless ENV['COVERBAND_HASH_REDIS_STORE']
|
|
46
48
|
@store.coverage.each_pair do |key, data|
|
47
49
|
assert_equal expected[key], data['data']
|
48
50
|
end
|
49
|
-
|
50
51
|
@store.type = Coverband::RUNTIME_TYPE
|
51
52
|
assert_equal [], @store.coverage.keys
|
52
53
|
end
|
@@ -56,9 +57,13 @@ unless ENV['COVERBAND_HASH_REDIS_STORE']
|
|
56
57
|
assert_equal Coverband::RUNTIME_TYPE, @store.type
|
57
58
|
@store.type = :eager_loading
|
58
59
|
@store.save_report('app_path/dog.rb' => [0, 1, 1])
|
60
|
+
# eager_loading doesn't set last_updated_at
|
61
|
+
assert_nil @store.coverage['app_path/dog.rb']['last_updated_at']
|
59
62
|
@store.type = Coverband::RUNTIME_TYPE
|
63
|
+
current_time = Time.now.to_i
|
60
64
|
@store.save_report('app_path/dog.rb' => [1, 0, 1])
|
61
65
|
assert_equal [1, 1, 2], @store.get_coverage_report[:merged]['app_path/dog.rb']['data']
|
66
|
+
assert current_time <= @store.coverage['app_path/dog.rb']['last_updated_at']
|
62
67
|
assert_equal Coverband::RUNTIME_TYPE, @store.type
|
63
68
|
end
|
64
69
|
|
@@ -2,16 +2,20 @@ require File.expand_path('../../test_helper', File.dirname(__FILE__))
|
|
2
2
|
|
3
3
|
class ReporterTest < Minitest::Test
|
4
4
|
|
5
|
+
def tracker_key
|
6
|
+
'render_tracker_2'
|
7
|
+
end
|
8
|
+
|
5
9
|
def setup
|
6
10
|
super
|
7
|
-
fake_store.raw_store.del(
|
11
|
+
fake_store.raw_store.del(tracker_key)
|
8
12
|
end
|
9
13
|
|
10
14
|
test "init correctly" do
|
11
15
|
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
12
|
-
tracker = Coverband::Collectors::ViewTracker.new(:store =>
|
16
|
+
tracker = Coverband::Collectors::ViewTracker.new(:store => fake_store, :roots => 'dir')
|
13
17
|
assert_equal 'dir', tracker.roots.first
|
14
|
-
|
18
|
+
assert tracker.store != nil
|
15
19
|
assert_equal [], tracker.target
|
16
20
|
assert_equal [], tracker.logged_views
|
17
21
|
end
|
@@ -20,7 +24,7 @@ class ReporterTest < Minitest::Test
|
|
20
24
|
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
21
25
|
store = fake_store
|
22
26
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/file"
|
23
|
-
store.raw_store.expects(:
|
27
|
+
store.raw_store.expects(:hset).with(tracker_key, file_path, anything)
|
24
28
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: 'dir')
|
25
29
|
tracker.track_views('name', 'start', 'finish', 'id', {:identifier => file_path})
|
26
30
|
tracker.report_views_tracked
|
@@ -31,7 +35,7 @@ class ReporterTest < Minitest::Test
|
|
31
35
|
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
32
36
|
store = fake_store
|
33
37
|
file_path = "#{File.expand_path(Coverband.configuration.root)}/layout"
|
34
|
-
store.raw_store.expects(:
|
38
|
+
store.raw_store.expects(:hset).with(tracker_key, file_path, anything)
|
35
39
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: 'dir')
|
36
40
|
tracker.track_views('name', 'start', 'finish', 'id', {:layout => file_path})
|
37
41
|
tracker.report_views_tracked
|
@@ -45,7 +49,7 @@ class ReporterTest < Minitest::Test
|
|
45
49
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: 'dir')
|
46
50
|
tracker.track_views('name', 'start', 'finish', 'id', {:identifier => file_path})
|
47
51
|
tracker.report_views_tracked
|
48
|
-
assert_equal [file_path], tracker.used_views
|
52
|
+
assert_equal [file_path], tracker.used_views.keys
|
49
53
|
end
|
50
54
|
|
51
55
|
test "report unused partials" do
|
@@ -62,12 +66,24 @@ class ReporterTest < Minitest::Test
|
|
62
66
|
test "reset store" do
|
63
67
|
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
64
68
|
store = fake_store
|
65
|
-
store.raw_store.expects(:del).with(
|
69
|
+
store.raw_store.expects(:del).with(tracker_key)
|
70
|
+
store.raw_store.expects(:del).with('render_tracker_time')
|
66
71
|
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: 'dir')
|
67
72
|
tracker.track_views('name', 'start', 'finish', 'id', {:identifier => 'file'})
|
68
73
|
tracker.reset_recordings
|
69
74
|
end
|
70
75
|
|
76
|
+
test "clear_file" do
|
77
|
+
Coverband::Collectors::ViewTracker.expects(:supported_version?).returns(true)
|
78
|
+
store = fake_store
|
79
|
+
file_path = "#{File.expand_path(Coverband.configuration.root)}/file"
|
80
|
+
store.raw_store.expects(:hdel).with(tracker_key, file_path)
|
81
|
+
tracker = Coverband::Collectors::ViewTracker.new(store: store, roots: 'dir')
|
82
|
+
tracker.track_views('name', 'start', 'finish', 'id', {:identifier => file_path})
|
83
|
+
tracker.clear_file!('file')
|
84
|
+
assert_equal [], tracker.logged_views
|
85
|
+
end
|
86
|
+
|
71
87
|
protected
|
72
88
|
|
73
89
|
def fake_store
|
@@ -36,6 +36,19 @@ class ReportHTMLTest < Minitest::Test
|
|
36
36
|
assert_match 'app/models/user.rb', html
|
37
37
|
end
|
38
38
|
|
39
|
+
test 'files with no Coverage but in project details page list warning' do
|
40
|
+
@store.send(:save_report, basic_coverage_full_path)
|
41
|
+
|
42
|
+
filename = basic_coverage_file_full_path
|
43
|
+
base_path = Dir.pwd
|
44
|
+
# in project, but not in coverage data
|
45
|
+
html = Coverband::Reporters::HTMLReport.new(Coverband.configuration.store,
|
46
|
+
filename: "#{Dir.pwd}/test/fixtures/app/models/user.rb",
|
47
|
+
base_path: base_path,
|
48
|
+
open_report: false).file_details
|
49
|
+
assert_match 'This file was never loaded', html
|
50
|
+
end
|
51
|
+
|
39
52
|
test 'generate static HTML report file' do
|
40
53
|
@store.send(:save_report, basic_coverage)
|
41
54
|
|
@@ -62,6 +62,10 @@ describe Coverband::Utils::SourceFile do
|
|
62
62
|
it 'has 80% covered_percent' do
|
63
63
|
assert_equal 80.0, subject.covered_percent
|
64
64
|
end
|
65
|
+
|
66
|
+
it 'working for nil last_updated_at' do
|
67
|
+
assert_equal "not available", subject.last_updated_at
|
68
|
+
end
|
65
69
|
end
|
66
70
|
|
67
71
|
describe 'simulating potential Ruby 1.9 defect -- see Issue #56' do
|
data/views/file_list.erb
CHANGED
@@ -35,7 +35,8 @@
|
|
35
35
|
<tbody>
|
36
36
|
<% source_files.each do |source_file| %>
|
37
37
|
<tr>
|
38
|
-
|
38
|
+
<% source_class = source_file.never_loaded ? 'strong red' : 'strong'%>
|
39
|
+
<td class="<%= source_class %>">
|
39
40
|
<%= link_to_source_file(source_file) %>
|
40
41
|
</td>
|
41
42
|
<td class="<%= coverage_css_class(source_file.covered_percent) %> strong"><%= source_file.covered_percent.round(2).to_s %> %</td>
|
data/views/nav.erb
CHANGED
data/views/source_file.erb
CHANGED
@@ -15,6 +15,13 @@
|
|
15
15
|
<% if Coverband.configuration.web_enable_clear %>
|
16
16
|
<%= button("#{base_path}clear_file?filename=#{source_file.relative_path}", 'clear file coverage') %>
|
17
17
|
<% end %>
|
18
|
+
|
19
|
+
<% if source_file.never_loaded %>
|
20
|
+
<br/>
|
21
|
+
<span class="red">
|
22
|
+
<strong>This file was never loaded during app runtime or loading!</strong>
|
23
|
+
</span>
|
24
|
+
<% end %>
|
18
25
|
</h4>
|
19
26
|
<div>
|
20
27
|
<b><%= source_file.lines_of_code %></b> relevant lines.
|
data/views/view_tracker.erb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<title>Coverband Info: <%= Coverband::VERSION %></title>
|
5
5
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
6
|
+
<script src='<%= assets_path('dependencies.js') %>' type='text/javascript'></script>
|
6
7
|
<script src='<%= assets_path('application.js') %>' type='text/javascript'></script>
|
7
8
|
<link href='<%= assets_path('application.css') %>' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
8
9
|
<link rel="icon" type="image/png" href="<%= assets_path('favicon.png') %>" />
|
@@ -13,8 +14,13 @@
|
|
13
14
|
<%= display_nav(show_coverage_link: true) %>
|
14
15
|
<div id="content">
|
15
16
|
<% tracker = Coverband::Collectors::ViewTracker.new(store: Coverband.configuration.store) %>
|
17
|
+
<h3>
|
18
|
+
<% if Coverband.configuration.web_enable_clear %>
|
19
|
+
<%= button("#{base_path}clear_view_tracking", 'reset view tracker', delete: true) %>
|
20
|
+
<% end %>
|
21
|
+
</h3>
|
16
22
|
<h2>Unused Views: (<%= tracker.unused_views.length %>)</h2>
|
17
|
-
<p>These views have
|
23
|
+
<p>These views have not been rendered since recording started at <%= tracker.tracking_since %></p>
|
18
24
|
<ul>
|
19
25
|
<% tracker.unused_views.each do |view_file| %>
|
20
26
|
<li><%= view_file %></li>
|
@@ -24,8 +30,14 @@
|
|
24
30
|
<h2>Used Views: (<%= tracker.used_views.length %>)</h2>
|
25
31
|
<p>These views have been rendered at least once</p>
|
26
32
|
<ul>
|
27
|
-
<% tracker.used_views.
|
28
|
-
<li
|
33
|
+
<% tracker.used_views.each_pair do |view_file, time_at| %>
|
34
|
+
<li>
|
35
|
+
<%= view_file %>
|
36
|
+
<span class="last_seen_at">last activity recorded <%= Time.at(time_at.to_i)%></span>
|
37
|
+
<% if Coverband.configuration.web_enable_clear %>
|
38
|
+
<%= button("#{base_path}clear_view_tracking_file?filename=#{view_file}", 'reset tracked file', delete: true) %>
|
39
|
+
<% end %>
|
40
|
+
</li>
|
29
41
|
<% end %>
|
30
42
|
</ul>
|
31
43
|
</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coverband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.3.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Mayer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk-s3
|
@@ -426,9 +426,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
426
426
|
version: '0'
|
427
427
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
428
428
|
requirements:
|
429
|
-
- - "
|
429
|
+
- - ">"
|
430
430
|
- !ruby/object:Gem::Version
|
431
|
-
version:
|
431
|
+
version: 1.3.1
|
432
432
|
requirements: []
|
433
433
|
rubygems_version: 3.0.3
|
434
434
|
signing_key:
|