{"action":"created","comment":{"url":"https://api.github.com/repos/kapost/circuitry/pulls/comments/51021856","id":51021856,"diff_hunk":"@@ -0,0 +1,52 @@\n+require 'circuitry/services/sqs'\n+require 'circuitry/queue'\n+\n+module Circuitry\n+  class QueueCreator\n+    include Services::SQS\n+\n+    attr_reader :queue_name\n+\n+    def self.find_or_create(queue_name, dead_letter_queue_name: nil, max_receive_count: 8 )\n+      creator = new(queue_name)\n+      result = creator.create_queue\n+      creator.create_dead_letter_queue(dead_letter_queue_name, max_receive_count) if dead_letter_queue_name\n+      result\n+    end\n+\n+    def create_queue\n+      @_queue = Queue.new(create_primary_queue_internal) unless defined?(@_queue)","path":"lib/circuitry/queue_creator.rb","position":18,"original_position":18,"commit_id":"e578bf910ceff29e30e243a982aed8accb4af506","original_commit_id":"196f1e2b1330a244183a38ddec3d1331a96ac44d","user":{"login":"mhuggins","id":169093,"avatar_url":"https://avatars.githubusercontent.com/u/169093?v=3","gravatar_id":"","url":"https://api.github.com/users/mhuggins","html_url":"https://github.com/mhuggins","followers_url":"https://api.github.com/users/mhuggins/followers","following_url":"https://api.github.com/users/mhuggins/following{/other_user}","gists_url":"https://api.github.com/users/mhuggins/gists{/gist_id}","starred_url":"https://api.github.com/users/mhuggins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhuggins/subscriptions","organizations_url":"https://api.github.com/users/mhuggins/orgs","repos_url":"https://api.github.com/users/mhuggins/repos","events_url":"https://api.github.com/users/mhuggins/events{/privacy}","received_events_url":"https://api.github.com/users/mhuggins/received_events","type":"User","site_admin":false},"body":"Why not just `||=` here?","created_at":"2016-01-27T17:55:28Z","updated_at":"2016-01-27T17:55:28Z","html_url":"https://github.com/kapost/circuitry/pull/30#discussion_r51021856","pull_request_url":"https://api.github.com/repos/kapost/circuitry/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/kapost/circuitry/pulls/comments/51021856"},"html":{"href":"https://github.com/kapost/circuitry/pull/30#discussion_r51021856"},"pull_request":{"href":"https://api.github.com/repos/kapost/circuitry/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/kapost/circuitry/pulls/30","id":57394321,"html_url":"https://github.com/kapost/circuitry/pull/30","diff_url":"https://github.com/kapost/circuitry/pull/30.diff","patch_url":"https://github.com/kapost/circuitry/pull/30.patch","issue_url":"https://api.github.com/repos/kapost/circuitry/issues/30","number":30,"state":"open","locked":false,"title":"Auto provisioning via rake+CLI, subscriber/topic config","user":{"login":"brandonc","id":174332,"avatar_url":"https://avatars.githubusercontent.com/u/174332?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonc","html_url":"https://github.com/brandonc","followers_url":"https://api.github.com/users/brandonc/followers","following_url":"https://api.github.com/users/brandonc/following{/other_user}","gists_url":"https://api.github.com/users/brandonc/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonc/subscriptions","organizations_url":"https://api.github.com/users/brandonc/orgs","repos_url":"https://api.github.com/users/brandonc/repos","events_url":"https://api.github.com/users/brandonc/events{/privacy}","received_events_url":"https://api.github.com/users/brandonc/received_events","type":"User","site_admin":false},"body":"Adds a few QoL fixes to Amazon provisioning\r\n\r\n- Resolves competing provisioning code between CLI and rake task in previous PR\r\n- Changes the interface for Circuitry.subscribe to not use a queue url in favor of a config variable (circuitry subscribers should only have one queue), and bumps version to 2.0 due to this change.\r\n- Resolves a bunch of rubocop issues","created_at":"2016-01-27T17:32:24Z","updated_at":"2016-01-27T17:55:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb27d79d75072e4489c93fa2d0554bcbb36ad769","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kapost/circuitry/pulls/30/commits","review_comments_url":"https://api.github.com/repos/kapost/circuitry/pulls/30/comments","review_comment_url":"https://api.github.com/repos/kapost/circuitry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kapost/circuitry/issues/30/comments","statuses_url":"https://api.github.com/repos/kapost/circuitry/statuses/e578bf910ceff29e30e243a982aed8accb4af506","head":{"label":"kapost:auto_provisioning","ref":"auto_provisioning","sha":"e578bf910ceff29e30e243a982aed8accb4af506","user":{"login":"kapost","id":2104524,"avatar_url":"https://avatars.githubusercontent.com/u/2104524?v=3","gravatar_id":"","url":"https://api.github.com/users/kapost","html_url":"https://github.com/kapost","followers_url":"https://api.github.com/users/kapost/followers","following_url":"https://api.github.com/users/kapost/following{/other_user}","gists_url":"https://api.github.com/users/kapost/gists{/gist_id}","starred_url":"https://api.github.com/users/kapost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapost/subscriptions","organizations_url":"https://api.github.com/users/kapost/orgs","repos_url":"https://api.github.com/users/kapost/repos","events_url":"https://api.github.com/users/kapost/events{/privacy}","received_events_url":"https://api.github.com/users/kapost/received_events","type":"Organization","site_admin":false},"repo":{"id":36836081,"name":"circuitry","full_name":"kapost/circuitry","owner":{"login":"kapost","id":2104524,"avatar_url":"https://avatars.githubusercontent.com/u/2104524?v=3","gravatar_id":"","url":"https://api.github.com/users/kapost","html_url":"https://github.com/kapost","followers_url":"https://api.github.com/users/kapost/followers","following_url":"https://api.github.com/users/kapost/following{/other_user}","gists_url":"https://api.github.com/users/kapost/gists{/gist_id}","starred_url":"https://api.github.com/users/kapost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapost/subscriptions","organizations_url":"https://api.github.com/users/kapost/orgs","repos_url":"https://api.github.com/users/kapost/repos","events_url":"https://api.github.com/users/kapost/events{/privacy}","received_events_url":"https://api.github.com/users/kapost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kapost/circuitry","description":"Kapost notification pubsub and message queue processing","fork":false,"url":"https://api.github.com/repos/kapost/circuitry","forks_url":"https://api.github.com/repos/kapost/circuitry/forks","keys_url":"https://api.github.com/repos/kapost/circuitry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kapost/circuitry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kapost/circuitry/teams","hooks_url":"https://api.github.com/repos/kapost/circuitry/hooks","issue_events_url":"https://api.github.com/repos/kapost/circuitry/issues/events{/number}","events_url":"https://api.github.com/repos/kapost/circuitry/events","assignees_url":"https://api.github.com/repos/kapost/circuitry/assignees{/user}","branches_url":"https://api.github.com/repos/kapost/circuitry/branches{/branch}","tags_url":"https://api.github.com/repos/kapost/circuitry/tags","blobs_url":"https://api.github.com/repos/kapost/circuitry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kapost/circuitry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kapost/circuitry/git/refs{/sha}","trees_url":"https://api.github.com/repos/kapost/circuitry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kapost/circuitry/statuses/{sha}","languages_url":"https://api.github.com/repos/kapost/circuitry/languages","stargazers_url":"https://api.github.com/repos/kapost/circuitry/stargazers","contributors_url":"https://api.github.com/repos/kapost/circuitry/contributors","subscribers_url":"https://api.github.com/repos/kapost/circuitry/subscribers","subscription_url":"https://api.github.com/repos/kapost/circuitry/subscription","commits_url":"https://api.github.com/repos/kapost/circuitry/commits{/sha}","git_commits_url":"https://api.github.com/repos/kapost/circuitry/git/commits{/sha}","comments_url":"https://api.github.com/repos/kapost/circuitry/comments{/number}","issue_comment_url":"https://api.github.com/repos/kapost/circuitry/issues/comments{/number}","contents_url":"https://api.github.com/repos/kapost/circuitry/contents/{+path}","compare_url":"https://api.github.com/repos/kapost/circuitry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kapost/circuitry/merges","archive_url":"https://api.github.com/repos/kapost/circuitry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kapost/circuitry/downloads","issues_url":"https://api.github.com/repos/kapost/circuitry/issues{/number}","pulls_url":"https://api.github.com/repos/kapost/circuitry/pulls{/number}","milestones_url":"https://api.github.com/repos/kapost/circuitry/milestones{/number}","notifications_url":"https://api.github.com/repos/kapost/circuitry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kapost/circuitry/labels{/name}","releases_url":"https://api.github.com/repos/kapost/circuitry/releases{/id}","deployments_url":"https://api.github.com/repos/kapost/circuitry/deployments","created_at":"2015-06-03T23:20:41Z","updated_at":"2016-01-21T23:35:50Z","pushed_at":"2016-01-27T17:42:05Z","git_url":"git://github.com/kapost/circuitry.git","ssh_url":"git@github.com:kapost/circuitry.git","clone_url":"https://github.com/kapost/circuitry.git","svn_url":"https://github.com/kapost/circuitry","homepage":null,"size":140,"stargazers_count":41,"watchers_count":41,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":41,"default_branch":"master"}},"base":{"label":"kapost:master","ref":"master","sha":"8cdda605d921ccfddbc4257e2244c6ead7b0841d","user":{"login":"kapost","id":2104524,"avatar_url":"https://avatars.githubusercontent.com/u/2104524?v=3","gravatar_id":"","url":"https://api.github.com/users/kapost","html_url":"https://github.com/kapost","followers_url":"https://api.github.com/users/kapost/followers","following_url":"https://api.github.com/users/kapost/following{/other_user}","gists_url":"https://api.github.com/users/kapost/gists{/gist_id}","starred_url":"https://api.github.com/users/kapost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapost/subscriptions","organizations_url":"https://api.github.com/users/kapost/orgs","repos_url":"https://api.github.com/users/kapost/repos","events_url":"https://api.github.com/users/kapost/events{/privacy}","received_events_url":"https://api.github.com/users/kapost/received_events","type":"Organization","site_admin":false},"repo":{"id":36836081,"name":"circuitry","full_name":"kapost/circuitry","owner":{"login":"kapost","id":2104524,"avatar_url":"https://avatars.githubusercontent.com/u/2104524?v=3","gravatar_id":"","url":"https://api.github.com/users/kapost","html_url":"https://github.com/kapost","followers_url":"https://api.github.com/users/kapost/followers","following_url":"https://api.github.com/users/kapost/following{/other_user}","gists_url":"https://api.github.com/users/kapost/gists{/gist_id}","starred_url":"https://api.github.com/users/kapost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapost/subscriptions","organizations_url":"https://api.github.com/users/kapost/orgs","repos_url":"https://api.github.com/users/kapost/repos","events_url":"https://api.github.com/users/kapost/events{/privacy}","received_events_url":"https://api.github.com/users/kapost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kapost/circuitry","description":"Kapost notification pubsub and message queue processing","fork":false,"url":"https://api.github.com/repos/kapost/circuitry","forks_url":"https://api.github.com/repos/kapost/circuitry/forks","keys_url":"https://api.github.com/repos/kapost/circuitry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kapost/circuitry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kapost/circuitry/teams","hooks_url":"https://api.github.com/repos/kapost/circuitry/hooks","issue_events_url":"https://api.github.com/repos/kapost/circuitry/issues/events{/number}","events_url":"https://api.github.com/repos/kapost/circuitry/events","assignees_url":"https://api.github.com/repos/kapost/circuitry/assignees{/user}","branches_url":"https://api.github.com/repos/kapost/circuitry/branches{/branch}","tags_url":"https://api.github.com/repos/kapost/circuitry/tags","blobs_url":"https://api.github.com/repos/kapost/circuitry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kapost/circuitry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kapost/circuitry/git/refs{/sha}","trees_url":"https://api.github.com/repos/kapost/circuitry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kapost/circuitry/statuses/{sha}","languages_url":"https://api.github.com/repos/kapost/circuitry/languages","stargazers_url":"https://api.github.com/repos/kapost/circuitry/stargazers","contributors_url":"https://api.github.com/repos/kapost/circuitry/contributors","subscribers_url":"https://api.github.com/repos/kapost/circuitry/subscribers","subscription_url":"https://api.github.com/repos/kapost/circuitry/subscription","commits_url":"https://api.github.com/repos/kapost/circuitry/commits{/sha}","git_commits_url":"https://api.github.com/repos/kapost/circuitry/git/commits{/sha}","comments_url":"https://api.github.com/repos/kapost/circuitry/comments{/number}","issue_comment_url":"https://api.github.com/repos/kapost/circuitry/issues/comments{/number}","contents_url":"https://api.github.com/repos/kapost/circuitry/contents/{+path}","compare_url":"https://api.github.com/repos/kapost/circuitry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kapost/circuitry/merges","archive_url":"https://api.github.com/repos/kapost/circuitry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kapost/circuitry/downloads","issues_url":"https://api.github.com/repos/kapost/circuitry/issues{/number}","pulls_url":"https://api.github.com/repos/kapost/circuitry/pulls{/number}","milestones_url":"https://api.github.com/repos/kapost/circuitry/milestones{/number}","notifications_url":"https://api.github.com/repos/kapost/circuitry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kapost/circuitry/labels{/name}","releases_url":"https://api.github.com/repos/kapost/circuitry/releases{/id}","deployments_url":"https://api.github.com/repos/kapost/circuitry/deployments","created_at":"2015-06-03T23:20:41Z","updated_at":"2016-01-21T23:35:50Z","pushed_at":"2016-01-27T17:42:05Z","git_url":"git://github.com/kapost/circuitry.git","ssh_url":"git@github.com:kapost/circuitry.git","clone_url":"https://github.com/kapost/circuitry.git","svn_url":"https://github.com/kapost/circuitry","homepage":null,"size":140,"stargazers_count":41,"watchers_count":41,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kapost/circuitry/pulls/30"},"html":{"href":"https://github.com/kapost/circuitry/pull/30"},"issue":{"href":"https://api.github.com/repos/kapost/circuitry/issues/30"},"comments":{"href":"https://api.github.com/repos/kapost/circuitry/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/kapost/circuitry/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/kapost/circuitry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kapost/circuitry/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/kapost/circuitry/statuses/e578bf910ceff29e30e243a982aed8accb4af506"}}}}