Class: Spoom::Coverage::Report
- Defined in:
- lib/spoom/coverage/report.rb
Constant Summary
Constants inherited from Page
Instance Attribute Summary
Attributes inherited from Page
Instance Method Summary collapse
-
#cards ⇒ Object
: -> Array.
-
#header_html ⇒ Object
: -> String.
-
#initialize(project_name:, palette:, snapshots:, file_tree:, nodes_strictnesses:, nodes_strictness_scores:, sorbet_intro_commit: nil, sorbet_intro_date: nil) ⇒ Report
constructor
: (project_name: String, palette: D3::ColorPalette, snapshots: Array, file_tree: FileTree, nodes_strictnesses: Hash[FileTree::Node, String?], nodes_strictness_scores: Hash[FileTree::Node, Float], ?sorbet_intro_commit: String?, ?sorbet_intro_date: Time?) -> void.
Methods inherited from Page
#body_html, #footer_html, #header_script, #header_style
Methods inherited from Template
Constructor Details
#initialize(project_name:, palette:, snapshots:, file_tree:, nodes_strictnesses:, nodes_strictness_scores:, sorbet_intro_commit: nil, sorbet_intro_date: nil) ⇒ Report
: (project_name: String, palette: D3::ColorPalette, snapshots: Array, file_tree: FileTree, nodes_strictnesses: Hash[FileTree::Node, String?], nodes_strictness_scores: Hash[FileTree::Node, Float], ?sorbet_intro_commit: String?, ?sorbet_intro_date: Time?) -> void
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/spoom/coverage/report.rb', line 236 def initialize( project_name:, palette:, snapshots:, file_tree:, nodes_strictnesses:, nodes_strictness_scores:, sorbet_intro_commit: nil, sorbet_intro_date: nil ) super(title: project_name, palette: palette) @project_name = project_name @snapshots = snapshots @file_tree = file_tree @nodes_strictnesses = nodes_strictnesses @nodes_strictness_scores = nodes_strictness_scores @sorbet_intro_commit = sorbet_intro_commit @sorbet_intro_date = sorbet_intro_date end |
Instance Method Details
#cards ⇒ Object
: -> Array
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/spoom/coverage/report.rb', line 270 def cards last = T.must(@snapshots.last) cards = [] cards << Cards::Snapshot.new(snapshot: last) cards << Cards::Map.new( file_tree: @file_tree, nodes_strictnesses: @nodes_strictnesses, nodes_strictness_scores: @nodes_strictness_scores, ) cards << Cards::Timeline::Sigils.new(snapshots: @snapshots) cards << Cards::Timeline::Calls.new(snapshots: @snapshots) cards << Cards::Timeline::Sigs.new(snapshots: @snapshots) cards << Cards::Timeline::RBIs.new(snapshots: @snapshots) cards << Cards::Timeline::Versions.new(snapshots: @snapshots) cards << Cards::Timeline::Runtimes.new(snapshots: @snapshots) cards << Cards::SorbetIntro.new( sorbet_intro_commit: @sorbet_intro_commit, sorbet_intro_date: @sorbet_intro_date, ) cards end |
#header_html ⇒ Object
: -> String
258 259 260 261 262 263 264 265 266 |
# File 'lib/spoom/coverage/report.rb', line 258 def header_html last = T.must(@snapshots.last) <<~ERB <h1 class="display-3"> #{@project_name} <span class="badge badge-pill badge-dark" style="font-size: 20%;">#{last.commit_sha}</span> </h1> ERB end |