Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract multiple commands from Gem command #1574

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

paracycle
Copy link
Member

Motivation

We'd been using the Gem command to perform three distinct tasks:

  1. synchronize RBI files for gems
  2. generate RBI files for specified or all gems
  3. verify that the gem RBI files are up-to-date

All of this functionality bunched together in a single command was making it hard to change behaviour or to add uniform behaviour to all Command classes, since not all of them would call the execute method in the end.

Implementation

This PR extracts an abstact gem command super class and splits the previous Gem command into separate commands that each handle one of these three tasks.

Tests

There should be no behaviour change.

@paracycle paracycle added the refactor Code refactor with no behaviour change label Jul 20, 2023
@paracycle paracycle requested a review from a team as a code owner July 20, 2023 21:00
@paracycle paracycle requested review from andyw8 and Morriar July 20, 2023 21:00
We'd been using the `Gem` command to perform three distinct tasks:
1. synchronize RBI files for gems
2. generate RBI files for specified or all gems
3. verify that the gem RBI files are up-to-date

This commit extracts an abstact gem command super class and splits the previous `Gem` command into separate commands that each handle one of these three tasks.
@paracycle paracycle force-pushed the uk-refactor-gem-command-classes branch from cfd102b to d9be453 Compare July 20, 2023 21:16
Copy link
Collaborator

@Morriar Morriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@paracycle paracycle merged commit afd5ebf into main Jul 21, 2023
30 checks passed
@paracycle paracycle deleted the uk-refactor-gem-command-classes branch July 21, 2023 16:35
@shopify-shipit shopify-shipit bot temporarily deployed to production September 13, 2023 22:55 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code refactor with no behaviour change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants