{"action":"created","comment":{"url":"https://api.github.com/repos/harrystech/dynosaur/pulls/comments/38976089","id":38976089,"diff_hunk":"@@ -0,0 +1,36 @@\n+require 'aws-sdk-v1'\n+\n+module Dynosaur::ErrorHandler\n+  class Ses < BaseHandler\n+    def initialize(config)\n+      @to = config[:to]\n+      @from = config[:from]\n+      @aws_access_key_id = config[:aws_access_key_id]\n+      @aws_secret_access_key = config[:aws_secret_access_key]\n+\n+      if @to.blank? || @from.blank? || @aws_access_key_id.blank? || @aws_secret_access_key.blank?\n+        raise ArgumentError.new \"Need to configure SES params\"\n+      end\n+\n+      @ses = AWS::SimpleEmailService.new(\n+        access_key_id: @aws_access_key_id,\n+        secret_access_key: @aws_secret_access_key)\n+      super\n+    end\n+\n+    def handle(exception)\n+        puts \"Reporting error to #{@to}\"\n+        msg = \"<div style='font-family: monospace;'>\"\n+        msg += exception.message.to_s + \"<br>\"\n+        msg += exception.backtrace.join(\"<br>\")\n+        msg += \"</div>\"\n+\n+        @ses.send_email(\n+          from: @from,\n+          to: @to,\n+          subject: \"Dynosaur Error\",\n+          body_html: msg)\n+    end\n+  end","path":"lib/dynosaur/error_handler/ses.rb","position":34,"original_position":34,"commit_id":"1c14932c7aa7d3fcffa014bd8b8ef20b8ba7f51c","original_commit_id":"1c14932c7aa7d3fcffa014bd8b8ef20b8ba7f51c","user":{"login":"pjambet","id":717637,"avatar_url":"https://avatars.githubusercontent.com/u/717637?v=3","gravatar_id":"","url":"https://api.github.com/users/pjambet","html_url":"https://github.com/pjambet","followers_url":"https://api.github.com/users/pjambet/followers","following_url":"https://api.github.com/users/pjambet/following{/other_user}","gists_url":"https://api.github.com/users/pjambet/gists{/gist_id}","starred_url":"https://api.github.com/users/pjambet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjambet/subscriptions","organizations_url":"https://api.github.com/users/pjambet/orgs","repos_url":"https://api.github.com/users/pjambet/repos","events_url":"https://api.github.com/users/pjambet/events{/privacy}","received_events_url":"https://api.github.com/users/pjambet/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-09-08T20:31:40Z","updated_at":"2015-09-08T20:31:40Z","html_url":"https://github.com/harrystech/dynosaur/pull/13#discussion_r38976089","pull_request_url":"https://api.github.com/repos/harrystech/dynosaur/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/harrystech/dynosaur/pulls/comments/38976089"},"html":{"href":"https://github.com/harrystech/dynosaur/pull/13#discussion_r38976089"},"pull_request":{"href":"https://api.github.com/repos/harrystech/dynosaur/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/harrystech/dynosaur/pulls/13","id":44462994,"html_url":"https://github.com/harrystech/dynosaur/pull/13","diff_url":"https://github.com/harrystech/dynosaur/pull/13.diff","patch_url":"https://github.com/harrystech/dynosaur/pull/13.patch","issue_url":"https://api.github.com/repos/harrystech/dynosaur/issues/13","number":13,"state":"open","locked":false,"title":"Convert to Headless Program","user":{"login":"werkshy","id":3298,"avatar_url":"https://avatars.githubusercontent.com/u/3298?v=3","gravatar_id":"","url":"https://api.github.com/users/werkshy","html_url":"https://github.com/werkshy","followers_url":"https://api.github.com/users/werkshy/followers","following_url":"https://api.github.com/users/werkshy/following{/other_user}","gists_url":"https://api.github.com/users/werkshy/gists{/gist_id}","starred_url":"https://api.github.com/users/werkshy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/werkshy/subscriptions","organizations_url":"https://api.github.com/users/werkshy/orgs","repos_url":"https://api.github.com/users/werkshy/repos","events_url":"https://api.github.com/users/werkshy/events{/privacy}","received_events_url":"https://api.github.com/users/werkshy/received_events","type":"User","site_admin":false},"body":"- Drop support for dynosaur-rails\r\n- Only use YAML for config\r\n- Create pluggable error handlers and stats handlers\r\n- Add cronut ping support\r\n- Add specs\r\n\r\n- [x] Create harrys-dynosaur heroku app\r\n- [x] Set up cronut job\r\n- [ ] Update docs and sample config\r\n- [x] Set dashboard to use new metric name","created_at":"2015-09-08T17:58:09Z","updated_at":"2015-09-08T20:31:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d364a1c51dcaee7f796d6a83c962e6e95c5a6bba","assignee":{"login":"pjambet","id":717637,"avatar_url":"https://avatars.githubusercontent.com/u/717637?v=3","gravatar_id":"","url":"https://api.github.com/users/pjambet","html_url":"https://github.com/pjambet","followers_url":"https://api.github.com/users/pjambet/followers","following_url":"https://api.github.com/users/pjambet/following{/other_user}","gists_url":"https://api.github.com/users/pjambet/gists{/gist_id}","starred_url":"https://api.github.com/users/pjambet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjambet/subscriptions","organizations_url":"https://api.github.com/users/pjambet/orgs","repos_url":"https://api.github.com/users/pjambet/repos","events_url":"https://api.github.com/users/pjambet/events{/privacy}","received_events_url":"https://api.github.com/users/pjambet/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/harrystech/dynosaur/pulls/13/commits","review_comments_url":"https://api.github.com/repos/harrystech/dynosaur/pulls/13/comments","review_comment_url":"https://api.github.com/repos/harrystech/dynosaur/pulls/comments{/number}","comments_url":"https://api.github.com/repos/harrystech/dynosaur/issues/13/comments","statuses_url":"https://api.github.com/repos/harrystech/dynosaur/statuses/1c14932c7aa7d3fcffa014bd8b8ef20b8ba7f51c","head":{"label":"harrystech:headless","ref":"headless","sha":"1c14932c7aa7d3fcffa014bd8b8ef20b8ba7f51c","user":{"login":"harrystech","id":3483749,"avatar_url":"https://avatars.githubusercontent.com/u/3483749?v=3","gravatar_id":"","url":"https://api.github.com/users/harrystech","html_url":"https://github.com/harrystech","followers_url":"https://api.github.com/users/harrystech/followers","following_url":"https://api.github.com/users/harrystech/following{/other_user}","gists_url":"https://api.github.com/users/harrystech/gists{/gist_id}","starred_url":"https://api.github.com/users/harrystech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrystech/subscriptions","organizations_url":"https://api.github.com/users/harrystech/orgs","repos_url":"https://api.github.com/users/harrystech/repos","events_url":"https://api.github.com/users/harrystech/events{/privacy}","received_events_url":"https://api.github.com/users/harrystech/received_events","type":"Organization","site_admin":false},"repo":{"id":13756007,"name":"dynosaur","full_name":"harrystech/dynosaur","owner":{"login":"harrystech","id":3483749,"avatar_url":"https://avatars.githubusercontent.com/u/3483749?v=3","gravatar_id":"","url":"https://api.github.com/users/harrystech","html_url":"https://github.com/harrystech","followers_url":"https://api.github.com/users/harrystech/followers","following_url":"https://api.github.com/users/harrystech/following{/other_user}","gists_url":"https://api.github.com/users/harrystech/gists{/gist_id}","starred_url":"https://api.github.com/users/harrystech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrystech/subscriptions","organizations_url":"https://api.github.com/users/harrystech/orgs","repos_url":"https://api.github.com/users/harrystech/repos","events_url":"https://api.github.com/users/harrystech/events{/privacy}","received_events_url":"https://api.github.com/users/harrystech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/harrystech/dynosaur","description":"An auto-scaling engine for Heroku web dynos using pluggable API connections.","fork":false,"url":"https://api.github.com/repos/harrystech/dynosaur","forks_url":"https://api.github.com/repos/harrystech/dynosaur/forks","keys_url":"https://api.github.com/repos/harrystech/dynosaur/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harrystech/dynosaur/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harrystech/dynosaur/teams","hooks_url":"https://api.github.com/repos/harrystech/dynosaur/hooks","issue_events_url":"https://api.github.com/repos/harrystech/dynosaur/issues/events{/number}","events_url":"https://api.github.com/repos/harrystech/dynosaur/events","assignees_url":"https://api.github.com/repos/harrystech/dynosaur/assignees{/user}","branches_url":"https://api.github.com/repos/harrystech/dynosaur/branches{/branch}","tags_url":"https://api.github.com/repos/harrystech/dynosaur/tags","blobs_url":"https://api.github.com/repos/harrystech/dynosaur/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harrystech/dynosaur/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harrystech/dynosaur/git/refs{/sha}","trees_url":"https://api.github.com/repos/harrystech/dynosaur/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harrystech/dynosaur/statuses/{sha}","languages_url":"https://api.github.com/repos/harrystech/dynosaur/languages","stargazers_url":"https://api.github.com/repos/harrystech/dynosaur/stargazers","contributors_url":"https://api.github.com/repos/harrystech/dynosaur/contributors","subscribers_url":"https://api.github.com/repos/harrystech/dynosaur/subscribers","subscription_url":"https://api.github.com/repos/harrystech/dynosaur/subscription","commits_url":"https://api.github.com/repos/harrystech/dynosaur/commits{/sha}","git_commits_url":"https://api.github.com/repos/harrystech/dynosaur/git/commits{/sha}","comments_url":"https://api.github.com/repos/harrystech/dynosaur/comments{/number}","issue_comment_url":"https://api.github.com/repos/harrystech/dynosaur/issues/comments{/number}","contents_url":"https://api.github.com/repos/harrystech/dynosaur/contents/{+path}","compare_url":"https://api.github.com/repos/harrystech/dynosaur/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harrystech/dynosaur/merges","archive_url":"https://api.github.com/repos/harrystech/dynosaur/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harrystech/dynosaur/downloads","issues_url":"https://api.github.com/repos/harrystech/dynosaur/issues{/number}","pulls_url":"https://api.github.com/repos/harrystech/dynosaur/pulls{/number}","milestones_url":"https://api.github.com/repos/harrystech/dynosaur/milestones{/number}","notifications_url":"https://api.github.com/repos/harrystech/dynosaur/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harrystech/dynosaur/labels{/name}","releases_url":"https://api.github.com/repos/harrystech/dynosaur/releases{/id}","created_at":"2013-10-21T21:40:45Z","updated_at":"2015-07-29T23:27:19Z","pushed_at":"2015-09-08T19:59:00Z","git_url":"git://github.com/harrystech/dynosaur.git","ssh_url":"git@github.com:harrystech/dynosaur.git","clone_url":"https://github.com/harrystech/dynosaur.git","svn_url":"https://github.com/harrystech/dynosaur","homepage":null,"size":684,"stargazers_count":152,"watchers_count":152,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":152,"default_branch":"master"}},"base":{"label":"harrystech:master","ref":"master","sha":"a5c65caf4712476dab45bd61d5fcc60f81cebae6","user":{"login":"harrystech","id":3483749,"avatar_url":"https://avatars.githubusercontent.com/u/3483749?v=3","gravatar_id":"","url":"https://api.github.com/users/harrystech","html_url":"https://github.com/harrystech","followers_url":"https://api.github.com/users/harrystech/followers","following_url":"https://api.github.com/users/harrystech/following{/other_user}","gists_url":"https://api.github.com/users/harrystech/gists{/gist_id}","starred_url":"https://api.github.com/users/harrystech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrystech/subscriptions","organizations_url":"https://api.github.com/users/harrystech/orgs","repos_url":"https://api.github.com/users/harrystech/repos","events_url":"https://api.github.com/users/harrystech/events{/privacy}","received_events_url":"https://api.github.com/users/harrystech/received_events","type":"Organization","site_admin":false},"repo":{"id":13756007,"name":"dynosaur","full_name":"harrystech/dynosaur","owner":{"login":"harrystech","id":3483749,"avatar_url":"https://avatars.githubusercontent.com/u/3483749?v=3","gravatar_id":"","url":"https://api.github.com/users/harrystech","html_url":"https://github.com/harrystech","followers_url":"https://api.github.com/users/harrystech/followers","following_url":"https://api.github.com/users/harrystech/following{/other_user}","gists_url":"https://api.github.com/users/harrystech/gists{/gist_id}","starred_url":"https://api.github.com/users/harrystech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrystech/subscriptions","organizations_url":"https://api.github.com/users/harrystech/orgs","repos_url":"https://api.github.com/users/harrystech/repos","events_url":"https://api.github.com/users/harrystech/events{/privacy}","received_events_url":"https://api.github.com/users/harrystech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/harrystech/dynosaur","description":"An auto-scaling engine for Heroku web dynos using pluggable API connections.","fork":false,"url":"https://api.github.com/repos/harrystech/dynosaur","forks_url":"https://api.github.com/repos/harrystech/dynosaur/forks","keys_url":"https://api.github.com/repos/harrystech/dynosaur/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harrystech/dynosaur/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harrystech/dynosaur/teams","hooks_url":"https://api.github.com/repos/harrystech/dynosaur/hooks","issue_events_url":"https://api.github.com/repos/harrystech/dynosaur/issues/events{/number}","events_url":"https://api.github.com/repos/harrystech/dynosaur/events","assignees_url":"https://api.github.com/repos/harrystech/dynosaur/assignees{/user}","branches_url":"https://api.github.com/repos/harrystech/dynosaur/branches{/branch}","tags_url":"https://api.github.com/repos/harrystech/dynosaur/tags","blobs_url":"https://api.github.com/repos/harrystech/dynosaur/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harrystech/dynosaur/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harrystech/dynosaur/git/refs{/sha}","trees_url":"https://api.github.com/repos/harrystech/dynosaur/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harrystech/dynosaur/statuses/{sha}","languages_url":"https://api.github.com/repos/harrystech/dynosaur/languages","stargazers_url":"https://api.github.com/repos/harrystech/dynosaur/stargazers","contributors_url":"https://api.github.com/repos/harrystech/dynosaur/contributors","subscribers_url":"https://api.github.com/repos/harrystech/dynosaur/subscribers","subscription_url":"https://api.github.com/repos/harrystech/dynosaur/subscription","commits_url":"https://api.github.com/repos/harrystech/dynosaur/commits{/sha}","git_commits_url":"https://api.github.com/repos/harrystech/dynosaur/git/commits{/sha}","comments_url":"https://api.github.com/repos/harrystech/dynosaur/comments{/number}","issue_comment_url":"https://api.github.com/repos/harrystech/dynosaur/issues/comments{/number}","contents_url":"https://api.github.com/repos/harrystech/dynosaur/contents/{+path}","compare_url":"https://api.github.com/repos/harrystech/dynosaur/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harrystech/dynosaur/merges","archive_url":"https://api.github.com/repos/harrystech/dynosaur/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harrystech/dynosaur/downloads","issues_url":"https://api.github.com/repos/harrystech/dynosaur/issues{/number}","pulls_url":"https://api.github.com/repos/harrystech/dynosaur/pulls{/number}","milestones_url":"https://api.github.com/repos/harrystech/dynosaur/milestones{/number}","notifications_url":"https://api.github.com/repos/harrystech/dynosaur/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harrystech/dynosaur/labels{/name}","releases_url":"https://api.github.com/repos/harrystech/dynosaur/releases{/id}","created_at":"2013-10-21T21:40:45Z","updated_at":"2015-07-29T23:27:19Z","pushed_at":"2015-09-08T19:59:00Z","git_url":"git://github.com/harrystech/dynosaur.git","ssh_url":"git@github.com:harrystech/dynosaur.git","clone_url":"https://github.com/harrystech/dynosaur.git","svn_url":"https://github.com/harrystech/dynosaur","homepage":null,"size":684,"stargazers_count":152,"watchers_count":152,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":152,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/harrystech/dynosaur/pulls/13"},"html":{"href":"https://github.com/harrystech/dynosaur/pull/13"},"issue":{"href":"https://api.github.com/repos/harrystech/dynosaur/issues/13"},"comments":{"href":"https://api.github.com/repos/harrystech/dynosaur/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/harrystech/dynosaur/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/harrystech/dynosaur/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/harrystech/dynosaur/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/harrystech/dynosaur/statuses/1c14932c7aa7d3fcffa014bd8b8ef20b8ba7f51c"}}}}