Before, CLI::Table and its helper class CLI::Row were hardcoded to display updatable gems. In an upcoming feature I would like to display a second table, with a different set of columns.
This refactor makes the CLI::Table constructor more generic and moves the column definitions to a static builder method. We can add more builder methods in the future to support more table types.
I also moved the report generation logic out of Report.generate into its own Reporter class, in anticipation of the reporting logic becoming more complex as more features are added.
Finally, I fixed a misspelling in the Report API: updateable → updatable.
Before,
CLI::Table
and its helper classCLI::Row
were hardcoded to display updatable gems. In an upcoming feature I would like to display a second table, with a different set of columns.This refactor makes the
CLI::Table
constructor more generic and moves the column definitions to a static builder method. We can add more builder methods in the future to support more table types.I also moved the report generation logic out of
Report.generate
into its ownReporter
class, in anticipation of the reporting logic becoming more complex as more features are added.Finally, I fixed a misspelling in the
Report
API:updateable
→updatable
.