diff options
| author | Xu Cheng | 2015-12-02 14:35:42 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-12-03 13:46:59 +0800 |
| commit | 48950f2cc07d74a52411cf1fe8674409736291ab (patch) | |
| tree | 0da3b69048aea7198636e5f1bd2df3902fc9258b /Library/Homebrew/cmd | |
| parent | 9755662e49439c29d5724f5d71f3ba1f03cd9d6d (diff) | |
| download | brew-48950f2cc07d74a52411cf1fe8674409736291ab.tar.bz2 | |
centralize the logic of handling `homebrew-` in Tap.fetch
Closes Homebrew/homebrew#46537.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/update.rb | 6 |
3 files changed, 4 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index da50fe5d2..68e4c5425 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -69,7 +69,7 @@ module Homebrew def github_info(f) if f.tap? user, repo = f.tap.split("/", 2) - tap = Tap.fetch user, repo.gsub(/^homebrew-/, "") + tap = Tap.fetch user, repo if remote = tap.remote path = f.path.relative_path_from(tap.path) github_remote_path(remote, path) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index a1e13d9e6..7afa3462d 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -16,9 +16,7 @@ module Homebrew ARGV.named.each do |name| if !File.exist?(name) && (name !~ HOMEBREW_CORE_FORMULA_REGEX) \ && (name =~ HOMEBREW_TAP_FORMULA_REGEX || name =~ HOMEBREW_CASK_TAP_FORMULA_REGEX) - user = $1 - repo = $2.sub(/^homebrew-/, "") - tap = Tap.fetch(user, repo) + tap = Tap.fetch($1, $2) tap.install unless tap.installed? end end unless ARGV.force? diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index 504d4115b..10b4da661 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -403,10 +403,8 @@ class Report fetch(:D, []).each do |path| case path.to_s when HOMEBREW_TAP_PATH_REGEX - user = $1 - repo = $2.sub("homebrew-", "") oldname = path.basename(".rb").to_s - next unless newname = Tap.fetch(user, repo).formula_renames[oldname] + next unless newname = Tap.fetch($1, $2).formula_renames[oldname] else oldname = path.basename(".rb").to_s next unless newname = FORMULA_RENAMES[oldname] @@ -427,7 +425,7 @@ class Report def select_formula(key) fetch(key, []).map do |path, newpath| if path.to_s =~ HOMEBREW_TAP_PATH_REGEX - tap = "#{$1}/#{$2.sub("homebrew-", "")}" + tap = Tap.fetch($1, $2) if newpath ["#{tap}/#{path.basename(".rb")}", "#{tap}/#{newpath.basename(".rb")}"] else |
