Skip to content

Conversation

@neomilium
Copy link
Contributor

@neomilium neomilium commented Apr 21, 2021

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::Git module in order to clean code and structure it.
This PR is one more part of #206

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.
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

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!

@ekohl ekohl merged commit 06c34cb into voxpupuli:master Apr 22, 2021
@neomilium neomilium deleted the refactor-repository-related-code branch April 22, 2021 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants