From 793b58a68618dc21f6143aaf708f93efb5ed17c6 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 7 Sep 2014 17:11:20 -0500 Subject: [PATCH] gist-logs: always post config and doctor output Closes Homebrew/homebrew#32145. --- Library/Contributions/cmd/brew-gist-logs.rb | 24 +++++---------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/Library/Contributions/cmd/brew-gist-logs.rb b/Library/Contributions/cmd/brew-gist-logs.rb index 66fcd30f9b..b2357ef60c 100755 --- a/Library/Contributions/cmd/brew-gist-logs.rb +++ b/Library/Contributions/cmd/brew-gist-logs.rb @@ -15,8 +15,10 @@ def gist_logs f files = load_logs(f.name) - append_config(files) if ARGV.include? '--config' - append_doctor(files) if ARGV.include? '--doctor' + s = StringIO.new + Homebrew.dump_verbose_config(s) + files["config.out"] = { :content => s.string } + files["doctor.out"] = { :content => `brew doctor 2>&1` } url = create_gist(files) @@ -38,16 +40,6 @@ def load_logs name logs end -def append_config files - s = StringIO.new - Homebrew.dump_verbose_config(s) - files["config.out"] = { :content => s.string } -end - -def append_doctor files - files['doctor.out'] = {:content => `brew doctor 2>&1`} -end - def create_gist files post("/gists", "public" => true, "files" => files)["html_url"] end @@ -92,14 +84,8 @@ def post path, data Utils::JSON.load(body) end -def usage - puts "usage: brew gist-logs [options] " - puts - puts "options: --config, --doctor, --new-issue" -end - if ARGV.formulae.length != 1 - usage + puts "usage: brew gist-logs [--new-issue] " exit 1 end