{"action":"created","comment":{"url":"https://api.github.com/repos/archSeer/Scarlet/pulls/comments/38375352","id":38375352,"diff_hunk":"@@ -29,17 +29,26 @@ end\n @checksum = calc_checksum\n \n module Updater\n+  class UpdateFailed < StandardError\n+  end\n+\n   extend Scarlet::Daemon::Loggable\n \n   def self.git_update\n     data = Scarlet::Git.get_data\n     branch = data[:branch]\n-    throw :update_failed, 'no branch' unless branch\n-    system(\"git fetch origin\") || throw(:update_failed, 'Fetching failed')\n-    system(\"git reset --hard origin/#{branch}\") || throw(:update_failed, 'Reset failed')\n+    raise UpdateFailed, 'no branch obtained.' unless branch\n+\n+    system(\"git fetch origin\") || raise(UpdateFailed, 'git fetch failed')\n+    system(\"git reset --hard origin/#{branch}\") || raise(UpdateFailed, 'git reset failed')\n+\n     current_data = Scarlet::Git.get_data\n     log \"Updated from #{data[:commit]} to #{current_data[:commit]}\"\n-    false # false as in, did I fail?\n+  end\n+\n+  def self.install_gems\n+    log \"Installing gems\"\n+    system(\"bundle install\")","path":"bin/daemon","position":27,"original_position":27,"commit_id":"1ae03c0e4d639b0844da4e0c119f8b334b0ff10d","original_commit_id":"1ae03c0e4d639b0844da4e0c119f8b334b0ff10d","user":{"login":"archSeer","id":1372918,"avatar_url":"https://avatars.githubusercontent.com/u/1372918?v=3","gravatar_id":"","url":"https://api.github.com/users/archSeer","html_url":"https://github.com/archSeer","followers_url":"https://api.github.com/users/archSeer/followers","following_url":"https://api.github.com/users/archSeer/following{/other_user}","gists_url":"https://api.github.com/users/archSeer/gists{/gist_id}","starred_url":"https://api.github.com/users/archSeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archSeer/subscriptions","organizations_url":"https://api.github.com/users/archSeer/orgs","repos_url":"https://api.github.com/users/archSeer/repos","events_url":"https://api.github.com/users/archSeer/events{/privacy}","received_events_url":"https://api.github.com/users/archSeer/received_events","type":"User","site_admin":false},"body":"Just `bundle`","created_at":"2015-09-01T00:24:49Z","updated_at":"2015-09-01T00:24:49Z","html_url":"https://github.com/archSeer/Scarlet/pull/46#discussion_r38375352","pull_request_url":"https://api.github.com/repos/archSeer/Scarlet/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/archSeer/Scarlet/pulls/comments/38375352"},"html":{"href":"https://github.com/archSeer/Scarlet/pull/46#discussion_r38375352"},"pull_request":{"href":"https://api.github.com/repos/archSeer/Scarlet/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/archSeer/Scarlet/pulls/46","id":43825262,"html_url":"https://github.com/archSeer/Scarlet/pull/46","diff_url":"https://github.com/archSeer/Scarlet/pull/46.diff","patch_url":"https://github.com/archSeer/Scarlet/pull/46.patch","issue_url":"https://api.github.com/repos/archSeer/Scarlet/issues/46","number":46,"state":"open","locked":false,"title":"Fixed update rollbacks","user":{"login":"IceDragon200","id":1649873,"avatar_url":"https://avatars.githubusercontent.com/u/1649873?v=3","gravatar_id":"","url":"https://api.github.com/users/IceDragon200","html_url":"https://github.com/IceDragon200","followers_url":"https://api.github.com/users/IceDragon200/followers","following_url":"https://api.github.com/users/IceDragon200/following{/other_user}","gists_url":"https://api.github.com/users/IceDragon200/gists{/gist_id}","starred_url":"https://api.github.com/users/IceDragon200/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IceDragon200/subscriptions","organizations_url":"https://api.github.com/users/IceDragon200/orgs","repos_url":"https://api.github.com/users/IceDragon200/repos","events_url":"https://api.github.com/users/IceDragon200/events{/privacy}","received_events_url":"https://api.github.com/users/IceDragon200/received_events","type":"User","site_admin":false},"body":"After noticing that Gemfiles can cause the update to fail miserably, we need\r\nto rollback not only the git commit but also the installed gems, thankfully\r\nthe Gemfile.lock is present in the codebase to ensure working versions are reinstalled.","created_at":"2015-09-01T00:18:30Z","updated_at":"2015-09-01T00:24:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5031856fcbf0873fcd460d27072f37c763d02a87","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/archSeer/Scarlet/pulls/46/commits","review_comments_url":"https://api.github.com/repos/archSeer/Scarlet/pulls/46/comments","review_comment_url":"https://api.github.com/repos/archSeer/Scarlet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/archSeer/Scarlet/issues/46/comments","statuses_url":"https://api.github.com/repos/archSeer/Scarlet/statuses/1ae03c0e4d639b0844da4e0c119f8b334b0ff10d","head":{"label":"archSeer:proper-update-rollbacks","ref":"proper-update-rollbacks","sha":"1ae03c0e4d639b0844da4e0c119f8b334b0ff10d","user":{"login":"archSeer","id":1372918,"avatar_url":"https://avatars.githubusercontent.com/u/1372918?v=3","gravatar_id":"","url":"https://api.github.com/users/archSeer","html_url":"https://github.com/archSeer","followers_url":"https://api.github.com/users/archSeer/followers","following_url":"https://api.github.com/users/archSeer/following{/other_user}","gists_url":"https://api.github.com/users/archSeer/gists{/gist_id}","starred_url":"https://api.github.com/users/archSeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archSeer/subscriptions","organizations_url":"https://api.github.com/users/archSeer/orgs","repos_url":"https://api.github.com/users/archSeer/repos","events_url":"https://api.github.com/users/archSeer/events{/privacy}","received_events_url":"https://api.github.com/users/archSeer/received_events","type":"User","site_admin":false},"repo":{"id":4042543,"name":"Scarlet","full_name":"archSeer/Scarlet","owner":{"login":"archSeer","id":1372918,"avatar_url":"https://avatars.githubusercontent.com/u/1372918?v=3","gravatar_id":"","url":"https://api.github.com/users/archSeer","html_url":"https://github.com/archSeer","followers_url":"https://api.github.com/users/archSeer/followers","following_url":"https://api.github.com/users/archSeer/following{/other_user}","gists_url":"https://api.github.com/users/archSeer/gists{/gist_id}","starred_url":"https://api.github.com/users/archSeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archSeer/subscriptions","organizations_url":"https://api.github.com/users/archSeer/orgs","repos_url":"https://api.github.com/users/archSeer/repos","events_url":"https://api.github.com/users/archSeer/events{/privacy}","received_events_url":"https://api.github.com/users/archSeer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/archSeer/Scarlet","description":"Scriptable IRC bot framework. Full support for modern irc features: login tracking, SASL, SSL, DCC, CAP extensions","fork":false,"url":"https://api.github.com/repos/archSeer/Scarlet","forks_url":"https://api.github.com/repos/archSeer/Scarlet/forks","keys_url":"https://api.github.com/repos/archSeer/Scarlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/archSeer/Scarlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/archSeer/Scarlet/teams","hooks_url":"https://api.github.com/repos/archSeer/Scarlet/hooks","issue_events_url":"https://api.github.com/repos/archSeer/Scarlet/issues/events{/number}","events_url":"https://api.github.com/repos/archSeer/Scarlet/events","assignees_url":"https://api.github.com/repos/archSeer/Scarlet/assignees{/user}","branches_url":"https://api.github.com/repos/archSeer/Scarlet/branches{/branch}","tags_url":"https://api.github.com/repos/archSeer/Scarlet/tags","blobs_url":"https://api.github.com/repos/archSeer/Scarlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/archSeer/Scarlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/archSeer/Scarlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/archSeer/Scarlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/archSeer/Scarlet/statuses/{sha}","languages_url":"https://api.github.com/repos/archSeer/Scarlet/languages","stargazers_url":"https://api.github.com/repos/archSeer/Scarlet/stargazers","contributors_url":"https://api.github.com/repos/archSeer/Scarlet/contributors","subscribers_url":"https://api.github.com/repos/archSeer/Scarlet/subscribers","subscription_url":"https://api.github.com/repos/archSeer/Scarlet/subscription","commits_url":"https://api.github.com/repos/archSeer/Scarlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/archSeer/Scarlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/archSeer/Scarlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/archSeer/Scarlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/archSeer/Scarlet/contents/{+path}","compare_url":"https://api.github.com/repos/archSeer/Scarlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/archSeer/Scarlet/merges","archive_url":"https://api.github.com/repos/archSeer/Scarlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/archSeer/Scarlet/downloads","issues_url":"https://api.github.com/repos/archSeer/Scarlet/issues{/number}","pulls_url":"https://api.github.com/repos/archSeer/Scarlet/pulls{/number}","milestones_url":"https://api.github.com/repos/archSeer/Scarlet/milestones{/number}","notifications_url":"https://api.github.com/repos/archSeer/Scarlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/archSeer/Scarlet/labels{/name}","releases_url":"https://api.github.com/repos/archSeer/Scarlet/releases{/id}","created_at":"2012-04-16T16:01:20Z","updated_at":"2015-08-30T01:00:39Z","pushed_at":"2015-09-01T00:23:35Z","git_url":"git://github.com/archSeer/Scarlet.git","ssh_url":"git@github.com:archSeer/Scarlet.git","clone_url":"https://github.com/archSeer/Scarlet.git","svn_url":"https://github.com/archSeer/Scarlet","homepage":"","size":1887,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":5,"default_branch":"master"}},"base":{"label":"archSeer:master","ref":"master","sha":"5b8a140bcf0c0e6904b1223559bf6062d282b86e","user":{"login":"archSeer","id":1372918,"avatar_url":"https://avatars.githubusercontent.com/u/1372918?v=3","gravatar_id":"","url":"https://api.github.com/users/archSeer","html_url":"https://github.com/archSeer","followers_url":"https://api.github.com/users/archSeer/followers","following_url":"https://api.github.com/users/archSeer/following{/other_user}","gists_url":"https://api.github.com/users/archSeer/gists{/gist_id}","starred_url":"https://api.github.com/users/archSeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archSeer/subscriptions","organizations_url":"https://api.github.com/users/archSeer/orgs","repos_url":"https://api.github.com/users/archSeer/repos","events_url":"https://api.github.com/users/archSeer/events{/privacy}","received_events_url":"https://api.github.com/users/archSeer/received_events","type":"User","site_admin":false},"repo":{"id":4042543,"name":"Scarlet","full_name":"archSeer/Scarlet","owner":{"login":"archSeer","id":1372918,"avatar_url":"https://avatars.githubusercontent.com/u/1372918?v=3","gravatar_id":"","url":"https://api.github.com/users/archSeer","html_url":"https://github.com/archSeer","followers_url":"https://api.github.com/users/archSeer/followers","following_url":"https://api.github.com/users/archSeer/following{/other_user}","gists_url":"https://api.github.com/users/archSeer/gists{/gist_id}","starred_url":"https://api.github.com/users/archSeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archSeer/subscriptions","organizations_url":"https://api.github.com/users/archSeer/orgs","repos_url":"https://api.github.com/users/archSeer/repos","events_url":"https://api.github.com/users/archSeer/events{/privacy}","received_events_url":"https://api.github.com/users/archSeer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/archSeer/Scarlet","description":"Scriptable IRC bot framework. Full support for modern irc features: login tracking, SASL, SSL, DCC, CAP extensions","fork":false,"url":"https://api.github.com/repos/archSeer/Scarlet","forks_url":"https://api.github.com/repos/archSeer/Scarlet/forks","keys_url":"https://api.github.com/repos/archSeer/Scarlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/archSeer/Scarlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/archSeer/Scarlet/teams","hooks_url":"https://api.github.com/repos/archSeer/Scarlet/hooks","issue_events_url":"https://api.github.com/repos/archSeer/Scarlet/issues/events{/number}","events_url":"https://api.github.com/repos/archSeer/Scarlet/events","assignees_url":"https://api.github.com/repos/archSeer/Scarlet/assignees{/user}","branches_url":"https://api.github.com/repos/archSeer/Scarlet/branches{/branch}","tags_url":"https://api.github.com/repos/archSeer/Scarlet/tags","blobs_url":"https://api.github.com/repos/archSeer/Scarlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/archSeer/Scarlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/archSeer/Scarlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/archSeer/Scarlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/archSeer/Scarlet/statuses/{sha}","languages_url":"https://api.github.com/repos/archSeer/Scarlet/languages","stargazers_url":"https://api.github.com/repos/archSeer/Scarlet/stargazers","contributors_url":"https://api.github.com/repos/archSeer/Scarlet/contributors","subscribers_url":"https://api.github.com/repos/archSeer/Scarlet/subscribers","subscription_url":"https://api.github.com/repos/archSeer/Scarlet/subscription","commits_url":"https://api.github.com/repos/archSeer/Scarlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/archSeer/Scarlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/archSeer/Scarlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/archSeer/Scarlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/archSeer/Scarlet/contents/{+path}","compare_url":"https://api.github.com/repos/archSeer/Scarlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/archSeer/Scarlet/merges","archive_url":"https://api.github.com/repos/archSeer/Scarlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/archSeer/Scarlet/downloads","issues_url":"https://api.github.com/repos/archSeer/Scarlet/issues{/number}","pulls_url":"https://api.github.com/repos/archSeer/Scarlet/pulls{/number}","milestones_url":"https://api.github.com/repos/archSeer/Scarlet/milestones{/number}","notifications_url":"https://api.github.com/repos/archSeer/Scarlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/archSeer/Scarlet/labels{/name}","releases_url":"https://api.github.com/repos/archSeer/Scarlet/releases{/id}","created_at":"2012-04-16T16:01:20Z","updated_at":"2015-08-30T01:00:39Z","pushed_at":"2015-09-01T00:23:35Z","git_url":"git://github.com/archSeer/Scarlet.git","ssh_url":"git@github.com:archSeer/Scarlet.git","clone_url":"https://github.com/archSeer/Scarlet.git","svn_url":"https://github.com/archSeer/Scarlet","homepage":"","size":1887,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/archSeer/Scarlet/pulls/46"},"html":{"href":"https://github.com/archSeer/Scarlet/pull/46"},"issue":{"href":"https://api.github.com/repos/archSeer/Scarlet/issues/46"},"comments":{"href":"https://api.github.com/repos/archSeer/Scarlet/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/archSeer/Scarlet/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/archSeer/Scarlet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/archSeer/Scarlet/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/archSeer/Scarlet/statuses/1ae03c0e4d639b0844da4e0c119f8b334b0ff10d"}}}}