{"action":"created","comment":{"url":"https://api.github.com/repos/grnhse/spec-tiller/pulls/comments/22866064","id":22866064,"diff_hunk":"@@ -0,0 +1,30 @@\n+require 'travis'\n+\n+class TravisAPI\n+\n+  def self.get_logs(branch)\n+    client = Travis::Client.new('https://api.travis-ci.com')\n+    client.github_auth(ENV['GITHUB_TOKEN_FOR_TRAVIS_API'])\n+    repository = client.repo('grnhse/greenhouse')\n+    last_build = nil\n+\n+    repository.each_build do |build|\n+      next unless build.state == 'passed' || build.state == 'failed'\n+      if build.commit.branch == branch\n+        last_build = build\n+        break\n+      end\n+    end\n+\n+    raise 'No previous builds found for specified branch.' if build.nil?\n+\n+    profile_results = ''\n+\n+    last_build.jobs.each do |job|\n+      body = job.log.body\n+      profile_results += job.log.body if body\n+    end\n+\n+    profile_results\n+  end\n+end","path":"lib/spec_tiller/travis_api.rb","position":30,"original_position":30,"commit_id":"4c7b8dc44541b3927c2c8a1e469905b2218124c0","original_commit_id":"4c7b8dc44541b3927c2c8a1e469905b2218124c0","user":{"login":"jooshbzm","id":8533024,"avatar_url":"https://avatars.githubusercontent.com/u/8533024?v=3","gravatar_id":"","url":"https://api.github.com/users/jooshbzm","html_url":"https://github.com/jooshbzm","followers_url":"https://api.github.com/users/jooshbzm/followers","following_url":"https://api.github.com/users/jooshbzm/following{/other_user}","gists_url":"https://api.github.com/users/jooshbzm/gists{/gist_id}","starred_url":"https://api.github.com/users/jooshbzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jooshbzm/subscriptions","organizations_url":"https://api.github.com/users/jooshbzm/orgs","repos_url":"https://api.github.com/users/jooshbzm/repos","events_url":"https://api.github.com/users/jooshbzm/events{/privacy}","received_events_url":"https://api.github.com/users/jooshbzm/received_events","type":"User","site_admin":false},"body":"Whoops, I've been deleting those as I find them. I'll try to set up rubymine to add them.","created_at":"2015-01-13T14:52:38Z","updated_at":"2015-01-13T14:52:38Z","html_url":"https://github.com/grnhse/spec-tiller/pull/7#discussion_r22866064","pull_request_url":"https://api.github.com/repos/grnhse/spec-tiller/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/grnhse/spec-tiller/pulls/comments/22866064"},"html":{"href":"https://github.com/grnhse/spec-tiller/pull/7#discussion_r22866064"},"pull_request":{"href":"https://api.github.com/repos/grnhse/spec-tiller/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/grnhse/spec-tiller/pulls/7","id":27200357,"html_url":"https://github.com/grnhse/spec-tiller/pull/7","diff_url":"https://github.com/grnhse/spec-tiller/pull/7.diff","patch_url":"https://github.com/grnhse/spec-tiller/pull/7.patch","issue_url":"https://api.github.com/repos/grnhse/spec-tiller/issues/7","number":7,"state":"open","locked":false,"title":"Feature/feature/travis api redistribute","user":{"login":"jooshbzm","id":8533024,"avatar_url":"https://avatars.githubusercontent.com/u/8533024?v=3","gravatar_id":"","url":"https://api.github.com/users/jooshbzm","html_url":"https://github.com/jooshbzm","followers_url":"https://api.github.com/users/jooshbzm/followers","following_url":"https://api.github.com/users/jooshbzm/following{/other_user}","gists_url":"https://api.github.com/users/jooshbzm/gists{/gist_id}","starred_url":"https://api.github.com/users/jooshbzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jooshbzm/subscriptions","organizations_url":"https://api.github.com/users/jooshbzm/orgs","repos_url":"https://api.github.com/users/jooshbzm/repos","events_url":"https://api.github.com/users/jooshbzm/events{/privacy}","received_events_url":"https://api.github.com/users/jooshbzm/received_events","type":"User","site_admin":false},"body":"Test in combination with greenhouse/feature/testing-spec-tiller-travis-api","created_at":"2015-01-12T15:13:36Z","updated_at":"2015-01-13T14:52:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d607325b9fa21e168e036f65effc56f3a745096f","assignee":{"login":"mschmaus201","id":4138752,"avatar_url":"https://avatars.githubusercontent.com/u/4138752?v=3","gravatar_id":"","url":"https://api.github.com/users/mschmaus201","html_url":"https://github.com/mschmaus201","followers_url":"https://api.github.com/users/mschmaus201/followers","following_url":"https://api.github.com/users/mschmaus201/following{/other_user}","gists_url":"https://api.github.com/users/mschmaus201/gists{/gist_id}","starred_url":"https://api.github.com/users/mschmaus201/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschmaus201/subscriptions","organizations_url":"https://api.github.com/users/mschmaus201/orgs","repos_url":"https://api.github.com/users/mschmaus201/repos","events_url":"https://api.github.com/users/mschmaus201/events{/privacy}","received_events_url":"https://api.github.com/users/mschmaus201/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/grnhse/spec-tiller/pulls/7/commits","review_comments_url":"https://api.github.com/repos/grnhse/spec-tiller/pulls/7/comments","review_comment_url":"https://api.github.com/repos/grnhse/spec-tiller/pulls/comments/{number}","comments_url":"https://api.github.com/repos/grnhse/spec-tiller/issues/7/comments","statuses_url":"https://api.github.com/repos/grnhse/spec-tiller/statuses/4c7b8dc44541b3927c2c8a1e469905b2218124c0","head":{"label":"grnhse:feature/feature/travis-api-redistribute","ref":"feature/feature/travis-api-redistribute","sha":"4c7b8dc44541b3927c2c8a1e469905b2218124c0","user":{"login":"grnhse","id":5897040,"avatar_url":"https://avatars.githubusercontent.com/u/5897040?v=3","gravatar_id":"","url":"https://api.github.com/users/grnhse","html_url":"https://github.com/grnhse","followers_url":"https://api.github.com/users/grnhse/followers","following_url":"https://api.github.com/users/grnhse/following{/other_user}","gists_url":"https://api.github.com/users/grnhse/gists{/gist_id}","starred_url":"https://api.github.com/users/grnhse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grnhse/subscriptions","organizations_url":"https://api.github.com/users/grnhse/orgs","repos_url":"https://api.github.com/users/grnhse/repos","events_url":"https://api.github.com/users/grnhse/events{/privacy}","received_events_url":"https://api.github.com/users/grnhse/received_events","type":"Organization","site_admin":false},"repo":{"id":18815523,"name":"spec-tiller","full_name":"grnhse/spec-tiller","owner":{"login":"grnhse","id":5897040,"avatar_url":"https://avatars.githubusercontent.com/u/5897040?v=3","gravatar_id":"","url":"https://api.github.com/users/grnhse","html_url":"https://github.com/grnhse","followers_url":"https://api.github.com/users/grnhse/followers","following_url":"https://api.github.com/users/grnhse/following{/other_user}","gists_url":"https://api.github.com/users/grnhse/gists{/gist_id}","starred_url":"https://api.github.com/users/grnhse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grnhse/subscriptions","organizations_url":"https://api.github.com/users/grnhse/orgs","repos_url":"https://api.github.com/users/grnhse/repos","events_url":"https://api.github.com/users/grnhse/events{/privacy}","received_events_url":"https://api.github.com/users/grnhse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grnhse/spec-tiller","description":"","fork":false,"url":"https://api.github.com/repos/grnhse/spec-tiller","forks_url":"https://api.github.com/repos/grnhse/spec-tiller/forks","keys_url":"https://api.github.com/repos/grnhse/spec-tiller/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grnhse/spec-tiller/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grnhse/spec-tiller/teams","hooks_url":"https://api.github.com/repos/grnhse/spec-tiller/hooks","issue_events_url":"https://api.github.com/repos/grnhse/spec-tiller/issues/events{/number}","events_url":"https://api.github.com/repos/grnhse/spec-tiller/events","assignees_url":"https://api.github.com/repos/grnhse/spec-tiller/assignees{/user}","branches_url":"https://api.github.com/repos/grnhse/spec-tiller/branches{/branch}","tags_url":"https://api.github.com/repos/grnhse/spec-tiller/tags","blobs_url":"https://api.github.com/repos/grnhse/spec-tiller/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grnhse/spec-tiller/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grnhse/spec-tiller/git/refs{/sha}","trees_url":"https://api.github.com/repos/grnhse/spec-tiller/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grnhse/spec-tiller/statuses/{sha}","languages_url":"https://api.github.com/repos/grnhse/spec-tiller/languages","stargazers_url":"https://api.github.com/repos/grnhse/spec-tiller/stargazers","contributors_url":"https://api.github.com/repos/grnhse/spec-tiller/contributors","subscribers_url":"https://api.github.com/repos/grnhse/spec-tiller/subscribers","subscription_url":"https://api.github.com/repos/grnhse/spec-tiller/subscription","commits_url":"https://api.github.com/repos/grnhse/spec-tiller/commits{/sha}","git_commits_url":"https://api.github.com/repos/grnhse/spec-tiller/git/commits{/sha}","comments_url":"https://api.github.com/repos/grnhse/spec-tiller/comments{/number}","issue_comment_url":"https://api.github.com/repos/grnhse/spec-tiller/issues/comments/{number}","contents_url":"https://api.github.com/repos/grnhse/spec-tiller/contents/{+path}","compare_url":"https://api.github.com/repos/grnhse/spec-tiller/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grnhse/spec-tiller/merges","archive_url":"https://api.github.com/repos/grnhse/spec-tiller/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grnhse/spec-tiller/downloads","issues_url":"https://api.github.com/repos/grnhse/spec-tiller/issues{/number}","pulls_url":"https://api.github.com/repos/grnhse/spec-tiller/pulls{/number}","milestones_url":"https://api.github.com/repos/grnhse/spec-tiller/milestones{/number}","notifications_url":"https://api.github.com/repos/grnhse/spec-tiller/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grnhse/spec-tiller/labels{/name}","releases_url":"https://api.github.com/repos/grnhse/spec-tiller/releases{/id}","created_at":"2014-04-15T20:53:00Z","updated_at":"2015-01-07T20:05:14Z","pushed_at":"2015-01-12T16:07:06Z","git_url":"git://github.com/grnhse/spec-tiller.git","ssh_url":"git@github.com:grnhse/spec-tiller.git","clone_url":"https://github.com/grnhse/spec-tiller.git","svn_url":"https://github.com/grnhse/spec-tiller","homepage":null,"size":319,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":4,"default_branch":"master"}},"base":{"label":"grnhse:master","ref":"master","sha":"fa4b181eea5a862a6f2bf02e044461d377ba4949","user":{"login":"grnhse","id":5897040,"avatar_url":"https://avatars.githubusercontent.com/u/5897040?v=3","gravatar_id":"","url":"https://api.github.com/users/grnhse","html_url":"https://github.com/grnhse","followers_url":"https://api.github.com/users/grnhse/followers","following_url":"https://api.github.com/users/grnhse/following{/other_user}","gists_url":"https://api.github.com/users/grnhse/gists{/gist_id}","starred_url":"https://api.github.com/users/grnhse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grnhse/subscriptions","organizations_url":"https://api.github.com/users/grnhse/orgs","repos_url":"https://api.github.com/users/grnhse/repos","events_url":"https://api.github.com/users/grnhse/events{/privacy}","received_events_url":"https://api.github.com/users/grnhse/received_events","type":"Organization","site_admin":false},"repo":{"id":18815523,"name":"spec-tiller","full_name":"grnhse/spec-tiller","owner":{"login":"grnhse","id":5897040,"avatar_url":"https://avatars.githubusercontent.com/u/5897040?v=3","gravatar_id":"","url":"https://api.github.com/users/grnhse","html_url":"https://github.com/grnhse","followers_url":"https://api.github.com/users/grnhse/followers","following_url":"https://api.github.com/users/grnhse/following{/other_user}","gists_url":"https://api.github.com/users/grnhse/gists{/gist_id}","starred_url":"https://api.github.com/users/grnhse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grnhse/subscriptions","organizations_url":"https://api.github.com/users/grnhse/orgs","repos_url":"https://api.github.com/users/grnhse/repos","events_url":"https://api.github.com/users/grnhse/events{/privacy}","received_events_url":"https://api.github.com/users/grnhse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grnhse/spec-tiller","description":"","fork":false,"url":"https://api.github.com/repos/grnhse/spec-tiller","forks_url":"https://api.github.com/repos/grnhse/spec-tiller/forks","keys_url":"https://api.github.com/repos/grnhse/spec-tiller/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grnhse/spec-tiller/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grnhse/spec-tiller/teams","hooks_url":"https://api.github.com/repos/grnhse/spec-tiller/hooks","issue_events_url":"https://api.github.com/repos/grnhse/spec-tiller/issues/events{/number}","events_url":"https://api.github.com/repos/grnhse/spec-tiller/events","assignees_url":"https://api.github.com/repos/grnhse/spec-tiller/assignees{/user}","branches_url":"https://api.github.com/repos/grnhse/spec-tiller/branches{/branch}","tags_url":"https://api.github.com/repos/grnhse/spec-tiller/tags","blobs_url":"https://api.github.com/repos/grnhse/spec-tiller/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grnhse/spec-tiller/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grnhse/spec-tiller/git/refs{/sha}","trees_url":"https://api.github.com/repos/grnhse/spec-tiller/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grnhse/spec-tiller/statuses/{sha}","languages_url":"https://api.github.com/repos/grnhse/spec-tiller/languages","stargazers_url":"https://api.github.com/repos/grnhse/spec-tiller/stargazers","contributors_url":"https://api.github.com/repos/grnhse/spec-tiller/contributors","subscribers_url":"https://api.github.com/repos/grnhse/spec-tiller/subscribers","subscription_url":"https://api.github.com/repos/grnhse/spec-tiller/subscription","commits_url":"https://api.github.com/repos/grnhse/spec-tiller/commits{/sha}","git_commits_url":"https://api.github.com/repos/grnhse/spec-tiller/git/commits{/sha}","comments_url":"https://api.github.com/repos/grnhse/spec-tiller/comments{/number}","issue_comment_url":"https://api.github.com/repos/grnhse/spec-tiller/issues/comments/{number}","contents_url":"https://api.github.com/repos/grnhse/spec-tiller/contents/{+path}","compare_url":"https://api.github.com/repos/grnhse/spec-tiller/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grnhse/spec-tiller/merges","archive_url":"https://api.github.com/repos/grnhse/spec-tiller/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grnhse/spec-tiller/downloads","issues_url":"https://api.github.com/repos/grnhse/spec-tiller/issues{/number}","pulls_url":"https://api.github.com/repos/grnhse/spec-tiller/pulls{/number}","milestones_url":"https://api.github.com/repos/grnhse/spec-tiller/milestones{/number}","notifications_url":"https://api.github.com/repos/grnhse/spec-tiller/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grnhse/spec-tiller/labels{/name}","releases_url":"https://api.github.com/repos/grnhse/spec-tiller/releases{/id}","created_at":"2014-04-15T20:53:00Z","updated_at":"2015-01-07T20:05:14Z","pushed_at":"2015-01-12T16:07:06Z","git_url":"git://github.com/grnhse/spec-tiller.git","ssh_url":"git@github.com:grnhse/spec-tiller.git","clone_url":"https://github.com/grnhse/spec-tiller.git","svn_url":"https://github.com/grnhse/spec-tiller","homepage":null,"size":319,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grnhse/spec-tiller/pulls/7"},"html":{"href":"https://github.com/grnhse/spec-tiller/pull/7"},"issue":{"href":"https://api.github.com/repos/grnhse/spec-tiller/issues/7"},"comments":{"href":"https://api.github.com/repos/grnhse/spec-tiller/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/grnhse/spec-tiller/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/grnhse/spec-tiller/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/grnhse/spec-tiller/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/grnhse/spec-tiller/statuses/4c7b8dc44541b3927c2c8a1e469905b2218124c0"}}}}