From 944ac75b2460859151c103efc2b49b31e133e9ec Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 7 Sep 2014 16:06:07 -0500 Subject: [PATCH] Use Formula#tap to get the repository name --- Library/Contributions/cmd/brew-gist-logs.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Library/Contributions/cmd/brew-gist-logs.rb b/Library/Contributions/cmd/brew-gist-logs.rb index 947570c97a..bc42302cda 100755 --- a/Library/Contributions/cmd/brew-gist-logs.rb +++ b/Library/Contributions/cmd/brew-gist-logs.rb @@ -11,7 +11,6 @@ def gist_logs f puts 'and then set HOMEBREW_GITHUB_API_TOKEN to use --new-issue option.' exit 1 end - repo = repo_name(f) end files = load_logs(f.name) @@ -22,7 +21,7 @@ def gist_logs f url = create_gist(files) if ARGV.include? '--new-issue' - url = new_issue(repo, "#{f.name} failed to build on #{MACOS_FULL_VERSION}", url) + url = new_issue(f.tap, "#{f.name} failed to build on #{MACOS_FULL_VERSION}", url) end ensure puts url if url @@ -98,15 +97,6 @@ class HTTP_Error < RuntimeError end end -def repo_name f - dir = f.path.dirname - url = dir.cd { `git config --get remote.origin.url` } - unless url =~ %r{github.com(?:/|:)([\w\d]+)/([\-\w\d]+)} - raise 'Unable to determine formula repository.' - end - "#{$1}/#{$2}" -end - def usage puts "usage: brew gist-logs [options] " puts