Refactor repository related code#214
Merged
ekohl merged 4 commits intovoxpupuli:masterfrom Apr 22, 2021
Merged
Conversation
This commit annotates ModuleSync::Git methods to show how the code will be splitted.
This commit renames ModuleSync::Git in ModuleSync::Repository
This commit is the main refactoring part of ModuleSync::Repository (formerly ModuleSync::Git). - It turns ModuleSync::Repository into a class to hold its properties (ie. directory and remote) - It renames some methods for readability: * #pull → #prepare_workspace * #update_noop → #show_changes * #update → submit_changes - It moves some `puts` in ModuleSync for consistency and code reusability Note: A method Repository#repo have been created as an alias for #git to keep history.
ekohl
approved these changes
Apr 22, 2021
Member
ekohl
left a comment
There was a problem hiding this comment.
I like this. It's a common pattern I've seen in multiple places where a module was used instead of a class. When (almost) every method static method has the same argument, you should have used a class instead. Thanks for cleaning this up!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All changes are detailed in commit logs.
Please note that the short log entries of these commits are lack of elegance, so I can merge them or if you have suggestions, I can reword them.
Nevertheless, this PR refactors the formerly
ModuleSync::Gitmodule in order to clean code and structure it.This PR is one more part of #206