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

Refactoring. #23821

Merged
merged 4 commits into from
Aug 17, 2016
Merged

Refactoring. #23821

merged 4 commits into from
Aug 17, 2016

Conversation

reitermarkus
Copy link
Member

@reitermarkus reitermarkus commented Aug 16, 2016

Changes to the core

@@ -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}"
Copy link
Contributor

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)

Copy link
Member Author

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")
Copy link
Member Author

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?

@reitermarkus reitermarkus added enhancement core Issue with Homebrew itself rather than with a specific cask. awaiting maintainer feedback Issue needs response from a maintainer. labels Aug 16, 2016
@reitermarkus reitermarkus merged commit 38c7e64 into Homebrew:master Aug 17, 2016
@reitermarkus reitermarkus deleted the refactoring branch August 17, 2016 14:38
jedahan pushed a commit to jedahan/homebrew-cask that referenced this pull request Sep 24, 2016
* Refactoring.

* Refactor pre-/postflight block artifacts.

* Use Homebrew’s `Tap` class.

* Overwrite TAP_DIRECTORY constant.
@miccal miccal removed the awaiting maintainer feedback Issue needs response from a maintainer. label Dec 15, 2016
@miccal miccal removed core Issue with Homebrew itself rather than with a specific cask. enhancement labels Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants