hacker_todo_list 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/hacker_todo_list.gemspec +1 -1
- data/lib/hacker_todo_list.rb +10 -2
- metadata +1 -1
data/hacker_todo_list.gemspec
CHANGED
data/lib/hacker_todo_list.rb
CHANGED
@@ -54,9 +54,17 @@ module HackerToDo
|
|
54
54
|
def find_todo_entry
|
55
55
|
todo_entry = self.class.get("/users/#{@github_creds[:username]}/gists",
|
56
56
|
{:basic_auth => @github_creds}).find do |gist|
|
57
|
-
|
57
|
+
unless gist.is_a?(Array)
|
58
|
+
gist["files"].has_key?(GIST_FILE_NAME) && gist["description"] == GIST_DESCRIPTION
|
59
|
+
end
|
60
|
+
end
|
61
|
+
if todo_entry
|
62
|
+
return self.class.get("/gists/#{todo_entry["id"]}", {:basic_auth => @github_creds})
|
63
|
+
else
|
64
|
+
puts "Your github credentials are incorrect"
|
65
|
+
system "rm -f #{HackerToDo::Setup::CREDENTIAL_FILE}"
|
66
|
+
return nil
|
58
67
|
end
|
59
|
-
self.class.get("/gists/#{todo_entry["id"]}", {:basic_auth => @github_creds}) if todo_entry
|
60
68
|
end
|
61
69
|
|
62
70
|
private
|