gist-logs: simplify setting the post path
This commit is contained in:
parent
944ac75b24
commit
832f88fbc1
@ -48,11 +48,11 @@ def append_doctor files
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create_gist files
|
def create_gist files
|
||||||
post('gists', {'public' => true, 'files' => files})['html_url']
|
post("/gists", "public" => true, "files" => files)["html_url"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_issue repo, title, body
|
def new_issue repo, title, body
|
||||||
post("repos/#{repo}/issues", {'title' => title, 'body' => body})['html_url']
|
post("/repos/#{repo}/issues", "title" => title, "body" => body)["html_url"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def http
|
def http
|
||||||
@ -70,7 +70,7 @@ def http
|
|||||||
end
|
end
|
||||||
|
|
||||||
def post path, data
|
def post path, data
|
||||||
request = Net::HTTP::Post.new("/#{path}")
|
request = Net::HTTP::Post.new(path)
|
||||||
request['User-Agent'] = HOMEBREW_USER_AGENT
|
request['User-Agent'] = HOMEBREW_USER_AGENT
|
||||||
request['Content-Type'] = 'application/json'
|
request['Content-Type'] = 'application/json'
|
||||||
if HOMEBREW_GITHUB_API_TOKEN
|
if HOMEBREW_GITHUB_API_TOKEN
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user