-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Support aliases. #116
Support aliases. #116
Conversation
@@ -61,6 +56,18 @@ def expand_cask_requirements | |||
|
|||
private | |||
|
|||
def self.formulae_info | |||
@@formulae_info ||= begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder do we need to cache this? Considering, it will only be run once for all of brew bundle
subcommands. Beside by removing the cache, we can remove formulae_info_reset!
at the same time.
If you want to keep it, you want to change @@formulae_info
to @formulae_info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a class-level cache so it can be reused across instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I mean it make more sense to cache the result after it is sorted based on dependency order.
In the core, we prefer to use singleton object variable over class variable. Although both can be used to share data among objects.
Since all of these class are only used once. I wonder should we turn all of them to singleton class? This may help to simplify the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using class variables elsewhere so I thought it was better to just be consistent here. Caching after sorted makes sense though 👍
You need to update Another problem is that only using name to check formula is not enough. We have to handle the case when full name is used in |
👍
Will test that case. |
It's 💚. @xu-cheng let me know what you think. |
You seem to miss that 😉
We still need to somehow support old name. Otherwise, |
Whoops, yep, I'll get it.
That's fine. I don't want to expose |
Also some other general cleanup and refactoring and ensuring that tests have 100% coverage.
Also some other general cleanup and refactoring and ensuring that tests have 100% coverage.
CC @xu-cheng