Skip to content

Commit 1cb2b65

Browse files
authored
Merge pull request #322 from lucasrangit/list-all-gists-with-token
Always pass the auth token when listing all gists
2 parents ab14e27 + e7bab05 commit 1cb2b65

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/gist.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,12 @@ def list_all_gists(user = "")
200200
url = "#{base_path}"
201201

202202
if user == ""
203-
access_token = auth_token()
204-
if access_token.to_s != ''
205-
url << "/gists?per_page=100"
206-
get_gist_pages(url, access_token)
207-
else
208-
raise Error, "Not authenticated. Use 'gist --login' to login or 'gist -l username' to view public gists."
209-
end
210-
203+
url << "/gists?per_page=100"
211204
else
212205
url << "/users/#{user}/gists?per_page=100"
213-
get_gist_pages(url)
214206
end
215207

208+
get_gist_pages(url, auth_token())
216209
end
217210

218211
def read_gist(id, file_name=nil)

0 commit comments

Comments
 (0)