File tree 7 files changed +27
-2
lines changed
7 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ gem "turbo-rails" # Hotwire's SPA-like page accelerator [https://turbo.hotwired.
12
12
gem "stimulus-rails" # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
13
13
gem "tailwindcss-rails" # Use Tailwind CSS [https://github.com/rails/tailwindcss-rails]
14
14
gem "sprockets-rails" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
15
+ gem "chartkick" , "~> 5.1" # Charts
15
16
16
17
# API
17
18
gem "jbuilder" # Build JSON APIs with ease [https://github.com/rails/jbuilder]
Original file line number Diff line number Diff line change 109
109
rack-test (>= 0.6.3 )
110
110
regexp_parser (>= 1.5 , < 3.0 )
111
111
xpath (~> 3.2 )
112
+ chartkick (5.1.2 )
112
113
concurrent-ruby (1.3.4 )
113
114
connection_pool (2.4.1 )
114
115
crass (1.0.6 )
@@ -397,6 +398,7 @@ DEPENDENCIES
397
398
bootsnap
398
399
brakeman
399
400
capybara
401
+ chartkick (~> 5.1 )
400
402
debug
401
403
devise (~> 4.9 )
402
404
dotenv-rails (~> 3.1 )
Original file line number Diff line number Diff line change 1
1
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2
2
import "@hotwired/turbo-rails"
3
3
import "controllers"
4
+
5
+ // https://chartkick.com/
6
+ import "chartkick"
7
+ import "Chart.bundle"
Original file line number Diff line number Diff line change @@ -19,4 +19,12 @@ def reset_api_auth!
19
19
update! ( api_auth_digest : Digest ::SHA512 . hexdigest ( token ) )
20
20
token
21
21
end
22
+
23
+ def reports_coverage_progress
24
+ reports . map do |report |
25
+ next if report . bundled_html . blank?
26
+
27
+ [ report . created_at , report . general_coverage ]
28
+ end
29
+ end
22
30
end
Original file line number Diff line number Diff line change @@ -58,10 +58,14 @@ def simplecov_generate_results
58
58
end
59
59
end
60
60
61
+ def general_coverage
62
+ results [ "general_coverage" ]
63
+ end
64
+
61
65
def formatted_coverage
62
- return if results [ " general_coverage" ] . blank?
66
+ return if general_coverage . blank?
63
67
64
- "#{ results [ " general_coverage" ] } %"
68
+ "#{ general_coverage } %"
65
69
end
66
70
67
71
private
Original file line number Diff line number Diff line change 2
2
< h5 > Project</ h5 >
3
3
< h1 > <%= @project . handle %> </ h1 >
4
4
5
+ <%= line_chart @project . reports_coverage_progress %>
6
+
5
7
< div >
6
8
< ul class ="list-disc ">
7
9
< h4 > Reports</ h4 >
Original file line number Diff line number Diff line change 5
5
pin "@hotwired/stimulus" , to : "stimulus.min.js"
6
6
pin "@hotwired/stimulus-loading" , to : "stimulus-loading.js"
7
7
pin_all_from "app/javascript/controllers" , under : "controllers"
8
+
9
+ # https://chartkick.com/
10
+ pin "chartkick" , to : "chartkick.js"
11
+ pin "Chart.bundle" , to : "Chart.bundle.js"
You can’t perform that action at this time.
0 commit comments