-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Refactoring. #23821
Refactoring. #23821
Conversation
@@ -3,15 +3,14 @@ | |||
class Hbc::Source::UntappedQualified < Hbc::Source::TappedQualified | |||
def self.path_for_query(query) | |||
user, repo, token = Hbc::QualifiedToken.parse(query) | |||
token.sub!(%r{\.rb$}i, "") | |||
tap = "#{user}/homebrew-#{repo}" | |||
tap = "#{user}/#{Hbc::QualifiedToken::REPO_PREFIX}#{repo}" |
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.
Since this is repeated in several places, it's probably worthwhile to extract it into a method (assuming Homebrew doesn't already have an equivalent one)
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.
Nice, Homebrew's Tap
class already has a cask_dir
method. 👍
# Override Tap::TAP_DIRECTORY to use our test Tap directory. | ||
class Tap | ||
send(:remove_const, :TAP_DIRECTORY) | ||
TAP_DIRECTORY = Hbc.homebrew_prefix.join("Library", "Taps") |
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.
@jawshooah, do you know a more elegant way to redefine constants, or an alternative approach?
* Refactoring. * Refactor pre-/postflight block artifacts. * Use Homebrew’s `Tap` class. * Overwrite TAP_DIRECTORY constant.
Changes to the core