hacker_todo_list 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'hacker_todo_list'
3
- s.version = '1.0.1'
3
+ s.version = '1.0.2'
4
4
  s.date = '2012-11-11'
5
5
  s.summary = "A command line To-Do list"
6
6
  s.description = %Q{
@@ -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
- gist && gist["files"].has_key?(GIST_FILE_NAME) && gist["description"] == GIST_DESCRIPTION
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hacker_todo_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: