mattbrictson / bundle_update_interactive

A stylish interactive mode for Bundler, inspired by `yarn upgrade-interactive`
MIT License
137 stars 3 forks source link

Refactor report and table API in anticipation of new features #36

Closed mattbrictson closed 1 month ago

mattbrictson commented 1 month ago

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: updateableupdatable.