{"action":"created","comment":{"url":"https://api.github.com/repos/prehnRA/lintron/pulls/comments/29580770","id":29580770,"diff_hunk":"@@ -0,0 +1,38 @@\n+class Status\n+  CONTEXT = 'Lintron'\n+\n+  attr_accessor :pr, :state, :description, :target_url\n+\n+  def self.process_with_status(pr, &block)\n+    Status.new(pr, :pending).send!\n+    begin\n+      yield block\n+      Status.new(pr, :success).send!\n+    rescue => e\n+      Status.new(pr, :error).send!\n+      fail e\n+    end\n+  end\n+\n+  def initialize(pr:, state:, description: nil, target_url: nil)\n+    @pr = pr\n+    @state = state\n+    @description = description\n+    @target_url = target_url\n+  end\n+\n+  def send!\n+    Github.repos.statuses.create pr.org, pr.repo, pr.to_gh.head.sha, body_params\n+  end\n+\n+  def body_params\n+    body_params = {\n+      state: state,\n+      context: CONTEXT,\n+      description: description,\n+      target_url: target_url\n+    }\n+\n+    body_params.delete_if { |k, v| v.nil? }","path":"app/models/status.rb","position":36,"original_position":36,"commit_id":"a3537b1e307878d4c9a2afc09c845bb931d18708","original_commit_id":"a3537b1e307878d4c9a2afc09c845bb931d18708","user":{"login":"prehnRA","id":3952444,"avatar_url":"https://avatars.githubusercontent.com/u/3952444?v=3","gravatar_id":"","url":"https://api.github.com/users/prehnRA","html_url":"https://github.com/prehnRA","followers_url":"https://api.github.com/users/prehnRA/followers","following_url":"https://api.github.com/users/prehnRA/following{/other_user}","gists_url":"https://api.github.com/users/prehnRA/gists{/gist_id}","starred_url":"https://api.github.com/users/prehnRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prehnRA/subscriptions","organizations_url":"https://api.github.com/users/prehnRA/orgs","repos_url":"https://api.github.com/users/prehnRA/repos","events_url":"https://api.github.com/users/prehnRA/events{/privacy}","received_events_url":"https://api.github.com/users/prehnRA/received_events","type":"User","site_admin":false},"body":"Unused block argument - `k`. If it's necessary, use `_` or `_k` as an argument name to indicate that it won't be used.","created_at":"2015-05-04T12:36:20Z","updated_at":"2015-05-04T12:36:20Z","html_url":"https://github.com/prehnRA/lintron/pull/4#discussion_r29580770","pull_request_url":"https://api.github.com/repos/prehnRA/lintron/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/prehnRA/lintron/pulls/comments/29580770"},"html":{"href":"https://github.com/prehnRA/lintron/pull/4#discussion_r29580770"},"pull_request":{"href":"https://api.github.com/repos/prehnRA/lintron/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/prehnRA/lintron/pulls/4","id":34633704,"html_url":"https://github.com/prehnRA/lintron/pull/4","diff_url":"https://github.com/prehnRA/lintron/pull/4.diff","patch_url":"https://github.com/prehnRA/lintron/pull/4.patch","issue_url":"https://api.github.com/repos/prehnRA/lintron/issues/4","number":4,"state":"open","locked":false,"title":"use the status API","user":{"login":"prehnRA","id":3952444,"avatar_url":"https://avatars.githubusercontent.com/u/3952444?v=3","gravatar_id":"","url":"https://api.github.com/users/prehnRA","html_url":"https://github.com/prehnRA","followers_url":"https://api.github.com/users/prehnRA/followers","following_url":"https://api.github.com/users/prehnRA/following{/other_user}","gists_url":"https://api.github.com/users/prehnRA/gists{/gist_id}","starred_url":"https://api.github.com/users/prehnRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prehnRA/subscriptions","organizations_url":"https://api.github.com/users/prehnRA/orgs","repos_url":"https://api.github.com/users/prehnRA/repos","events_url":"https://api.github.com/users/prehnRA/events{/privacy}","received_events_url":"https://api.github.com/users/prehnRA/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-04T12:33:49Z","updated_at":"2015-05-04T12:36:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e352fef306f1315caa12ea36cd172d2053e0a82","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/prehnRA/lintron/pulls/4/commits","review_comments_url":"https://api.github.com/repos/prehnRA/lintron/pulls/4/comments","review_comment_url":"https://api.github.com/repos/prehnRA/lintron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prehnRA/lintron/issues/4/comments","statuses_url":"https://api.github.com/repos/prehnRA/lintron/statuses/a3537b1e307878d4c9a2afc09c845bb931d18708","head":{"label":"prehnRA:f-status-api","ref":"f-status-api","sha":"a3537b1e307878d4c9a2afc09c845bb931d18708","user":{"login":"prehnRA","id":3952444,"avatar_url":"https://avatars.githubusercontent.com/u/3952444?v=3","gravatar_id":"","url":"https://api.github.com/users/prehnRA","html_url":"https://github.com/prehnRA","followers_url":"https://api.github.com/users/prehnRA/followers","following_url":"https://api.github.com/users/prehnRA/following{/other_user}","gists_url":"https://api.github.com/users/prehnRA/gists{/gist_id}","starred_url":"https://api.github.com/users/prehnRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prehnRA/subscriptions","organizations_url":"https://api.github.com/users/prehnRA/orgs","repos_url":"https://api.github.com/users/prehnRA/repos","events_url":"https://api.github.com/users/prehnRA/events{/privacy}","received_events_url":"https://api.github.com/users/prehnRA/received_events","type":"User","site_admin":false},"repo":{"id":34999057,"name":"lintron","full_name":"prehnRA/lintron","owner":{"login":"prehnRA","id":3952444,"avatar_url":"https://avatars.githubusercontent.com/u/3952444?v=3","gravatar_id":"","url":"https://api.github.com/users/prehnRA","html_url":"https://github.com/prehnRA","followers_url":"https://api.github.com/users/prehnRA/followers","following_url":"https://api.github.com/users/prehnRA/following{/other_user}","gists_url":"https://api.github.com/users/prehnRA/gists{/gist_id}","starred_url":"https://api.github.com/users/prehnRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prehnRA/subscriptions","organizations_url":"https://api.github.com/users/prehnRA/orgs","repos_url":"https://api.github.com/users/prehnRA/repos","events_url":"https://api.github.com/users/prehnRA/events{/privacy}","received_events_url":"https://api.github.com/users/prehnRA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/prehnRA/lintron","description":"An experiment in automated linting of pull requests.","fork":false,"url":"https://api.github.com/repos/prehnRA/lintron","forks_url":"https://api.github.com/repos/prehnRA/lintron/forks","keys_url":"https://api.github.com/repos/prehnRA/lintron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prehnRA/lintron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prehnRA/lintron/teams","hooks_url":"https://api.github.com/repos/prehnRA/lintron/hooks","issue_events_url":"https://api.github.com/repos/prehnRA/lintron/issues/events{/number}","events_url":"https://api.github.com/repos/prehnRA/lintron/events","assignees_url":"https://api.github.com/repos/prehnRA/lintron/assignees{/user}","branches_url":"https://api.github.com/repos/prehnRA/lintron/branches{/branch}","tags_url":"https://api.github.com/repos/prehnRA/lintron/tags","blobs_url":"https://api.github.com/repos/prehnRA/lintron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prehnRA/lintron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prehnRA/lintron/git/refs{/sha}","trees_url":"https://api.github.com/repos/prehnRA/lintron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prehnRA/lintron/statuses/{sha}","languages_url":"https://api.github.com/repos/prehnRA/lintron/languages","stargazers_url":"https://api.github.com/repos/prehnRA/lintron/stargazers","contributors_url":"https://api.github.com/repos/prehnRA/lintron/contributors","subscribers_url":"https://api.github.com/repos/prehnRA/lintron/subscribers","subscription_url":"https://api.github.com/repos/prehnRA/lintron/subscription","commits_url":"https://api.github.com/repos/prehnRA/lintron/commits{/sha}","git_commits_url":"https://api.github.com/repos/prehnRA/lintron/git/commits{/sha}","comments_url":"https://api.github.com/repos/prehnRA/lintron/comments{/number}","issue_comment_url":"https://api.github.com/repos/prehnRA/lintron/issues/comments{/number}","contents_url":"https://api.github.com/repos/prehnRA/lintron/contents/{+path}","compare_url":"https://api.github.com/repos/prehnRA/lintron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prehnRA/lintron/merges","archive_url":"https://api.github.com/repos/prehnRA/lintron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prehnRA/lintron/downloads","issues_url":"https://api.github.com/repos/prehnRA/lintron/issues{/number}","pulls_url":"https://api.github.com/repos/prehnRA/lintron/pulls{/number}","milestones_url":"https://api.github.com/repos/prehnRA/lintron/milestones{/number}","notifications_url":"https://api.github.com/repos/prehnRA/lintron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prehnRA/lintron/labels{/name}","releases_url":"https://api.github.com/repos/prehnRA/lintron/releases{/id}","created_at":"2015-05-03T20:07:48Z","updated_at":"2015-05-03T23:21:43Z","pushed_at":"2015-05-04T12:33:50Z","git_url":"git://github.com/prehnRA/lintron.git","ssh_url":"git@github.com:prehnRA/lintron.git","clone_url":"https://github.com/prehnRA/lintron.git","svn_url":"https://github.com/prehnRA/lintron","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"prehnRA:master","ref":"master","sha":"f592eac92e76daba4f2bf57baac1cd49b91d8ef1","user":{"login":"prehnRA","id":3952444,"avatar_url":"https://avatars.githubusercontent.com/u/3952444?v=3","gravatar_id":"","url":"https://api.github.com/users/prehnRA","html_url":"https://github.com/prehnRA","followers_url":"https://api.github.com/users/prehnRA/followers","following_url":"https://api.github.com/users/prehnRA/following{/other_user}","gists_url":"https://api.github.com/users/prehnRA/gists{/gist_id}","starred_url":"https://api.github.com/users/prehnRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prehnRA/subscriptions","organizations_url":"https://api.github.com/users/prehnRA/orgs","repos_url":"https://api.github.com/users/prehnRA/repos","events_url":"https://api.github.com/users/prehnRA/events{/privacy}","received_events_url":"https://api.github.com/users/prehnRA/received_events","type":"User","site_admin":false},"repo":{"id":34999057,"name":"lintron","full_name":"prehnRA/lintron","owner":{"login":"prehnRA","id":3952444,"avatar_url":"https://avatars.githubusercontent.com/u/3952444?v=3","gravatar_id":"","url":"https://api.github.com/users/prehnRA","html_url":"https://github.com/prehnRA","followers_url":"https://api.github.com/users/prehnRA/followers","following_url":"https://api.github.com/users/prehnRA/following{/other_user}","gists_url":"https://api.github.com/users/prehnRA/gists{/gist_id}","starred_url":"https://api.github.com/users/prehnRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prehnRA/subscriptions","organizations_url":"https://api.github.com/users/prehnRA/orgs","repos_url":"https://api.github.com/users/prehnRA/repos","events_url":"https://api.github.com/users/prehnRA/events{/privacy}","received_events_url":"https://api.github.com/users/prehnRA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/prehnRA/lintron","description":"An experiment in automated linting of pull requests.","fork":false,"url":"https://api.github.com/repos/prehnRA/lintron","forks_url":"https://api.github.com/repos/prehnRA/lintron/forks","keys_url":"https://api.github.com/repos/prehnRA/lintron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prehnRA/lintron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prehnRA/lintron/teams","hooks_url":"https://api.github.com/repos/prehnRA/lintron/hooks","issue_events_url":"https://api.github.com/repos/prehnRA/lintron/issues/events{/number}","events_url":"https://api.github.com/repos/prehnRA/lintron/events","assignees_url":"https://api.github.com/repos/prehnRA/lintron/assignees{/user}","branches_url":"https://api.github.com/repos/prehnRA/lintron/branches{/branch}","tags_url":"https://api.github.com/repos/prehnRA/lintron/tags","blobs_url":"https://api.github.com/repos/prehnRA/lintron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prehnRA/lintron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prehnRA/lintron/git/refs{/sha}","trees_url":"https://api.github.com/repos/prehnRA/lintron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prehnRA/lintron/statuses/{sha}","languages_url":"https://api.github.com/repos/prehnRA/lintron/languages","stargazers_url":"https://api.github.com/repos/prehnRA/lintron/stargazers","contributors_url":"https://api.github.com/repos/prehnRA/lintron/contributors","subscribers_url":"https://api.github.com/repos/prehnRA/lintron/subscribers","subscription_url":"https://api.github.com/repos/prehnRA/lintron/subscription","commits_url":"https://api.github.com/repos/prehnRA/lintron/commits{/sha}","git_commits_url":"https://api.github.com/repos/prehnRA/lintron/git/commits{/sha}","comments_url":"https://api.github.com/repos/prehnRA/lintron/comments{/number}","issue_comment_url":"https://api.github.com/repos/prehnRA/lintron/issues/comments{/number}","contents_url":"https://api.github.com/repos/prehnRA/lintron/contents/{+path}","compare_url":"https://api.github.com/repos/prehnRA/lintron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prehnRA/lintron/merges","archive_url":"https://api.github.com/repos/prehnRA/lintron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prehnRA/lintron/downloads","issues_url":"https://api.github.com/repos/prehnRA/lintron/issues{/number}","pulls_url":"https://api.github.com/repos/prehnRA/lintron/pulls{/number}","milestones_url":"https://api.github.com/repos/prehnRA/lintron/milestones{/number}","notifications_url":"https://api.github.com/repos/prehnRA/lintron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prehnRA/lintron/labels{/name}","releases_url":"https://api.github.com/repos/prehnRA/lintron/releases{/id}","created_at":"2015-05-03T20:07:48Z","updated_at":"2015-05-03T23:21:43Z","pushed_at":"2015-05-04T12:33:50Z","git_url":"git://github.com/prehnRA/lintron.git","ssh_url":"git@github.com:prehnRA/lintron.git","clone_url":"https://github.com/prehnRA/lintron.git","svn_url":"https://github.com/prehnRA/lintron","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prehnRA/lintron/pulls/4"},"html":{"href":"https://github.com/prehnRA/lintron/pull/4"},"issue":{"href":"https://api.github.com/repos/prehnRA/lintron/issues/4"},"comments":{"href":"https://api.github.com/repos/prehnRA/lintron/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/prehnRA/lintron/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/prehnRA/lintron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prehnRA/lintron/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/prehnRA/lintron/statuses/a3537b1e307878d4c9a2afc09c845bb931d18708"}}}}