{"action":"created","comment":{"url":"https://api.github.com/repos/testdouble/present/pulls/comments/92932708","pull_request_review_id":13456377,"id":92932708,"diff_hunk":"@@ -0,0 +1,48 @@\n+require_relative \"shake\"\n+\n+module Handshake\n+  class DeterminesShakes\n+    def initialize(random = Random.new)\n+      @random = random\n+    end\n+\n+    def determine(hands)\n+      least_recently_shaken(hands).each_with_object([]) { |hand, shakes|\n+        next if shakes.any? {|shake| shake.include?(hand) }","path":"lib/handshake/determines_shakes.rb","position":11,"original_position":11,"commit_id":"87b554cd2e039ea0e233ee0c6d768e47abd5dafe","original_commit_id":"87b554cd2e039ea0e233ee0c6d768e47abd5dafe","user":{"login":"stevenjackson","id":1396211,"avatar_url":"https://avatars.githubusercontent.com/u/1396211?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenjackson","html_url":"https://github.com/stevenjackson","followers_url":"https://api.github.com/users/stevenjackson/followers","following_url":"https://api.github.com/users/stevenjackson/following{/other_user}","gists_url":"https://api.github.com/users/stevenjackson/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenjackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenjackson/subscriptions","organizations_url":"https://api.github.com/users/stevenjackson/orgs","repos_url":"https://api.github.com/users/stevenjackson/repos","events_url":"https://api.github.com/users/stevenjackson/events{/privacy}","received_events_url":"https://api.github.com/users/stevenjackson/received_events","type":"User","site_admin":false},"body":"There's this recurring pattern where we have to filter out hands that have already been paired up.  Could this be simplified by transforming hands after each pairing?  It's less functional to be sure, but I'm wondering if shakes could be used to remove hands after each round.\r\n```\r\nhands_left = least_recently_shaken(hands)\r\nwhile hands_left.any? || hands_left.one? do\r\n   shakes << create_shake(hands_left)\r\n   hands_left -= shakes.last.hands\r\nend\r\n```","created_at":"2016-12-18T02:26:38Z","updated_at":"2016-12-18T02:35:31Z","html_url":"https://github.com/testdouble/present/pull/128#discussion_r92932708","pull_request_url":"https://api.github.com/repos/testdouble/present/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/testdouble/present/pulls/comments/92932708"},"html":{"href":"https://github.com/testdouble/present/pull/128#discussion_r92932708"},"pull_request":{"href":"https://api.github.com/repos/testdouble/present/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/testdouble/present/pulls/128","id":98455319,"html_url":"https://github.com/testdouble/present/pull/128","diff_url":"https://github.com/testdouble/present/pull/128.diff","patch_url":"https://github.com/testdouble/present/pull/128.patch","issue_url":"https://api.github.com/repos/testdouble/present/issues/128","number":128,"state":"open","locked":false,"title":"[Not Ready] Solve the handshake problem","user":{"login":"searls","id":79303,"avatar_url":"https://avatars.githubusercontent.com/u/79303?v=3","gravatar_id":"","url":"https://api.github.com/users/searls","html_url":"https://github.com/searls","followers_url":"https://api.github.com/users/searls/followers","following_url":"https://api.github.com/users/searls/following{/other_user}","gists_url":"https://api.github.com/users/searls/gists{/gist_id}","starred_url":"https://api.github.com/users/searls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/searls/subscriptions","organizations_url":"https://api.github.com/users/searls/orgs","repos_url":"https://api.github.com/users/searls/repos","events_url":"https://api.github.com/users/searls/events{/privacy}","received_events_url":"https://api.github.com/users/searls/received_events","type":"User","site_admin":false},"body":"So @drlieber had a great idea at @testdouble's recent retreat: we should have a system that automatically encourages people to have a virtual \"coffee date\" with another member of the team that they might otherwise never have a reason to chat with, especially because everyone works remotely. It was such an obviously good idea in hindsight, that everyone jumped on board right away. \r\n\r\nAs I chewed on the problem of asking \"how would a system determine which two people to match each week for a coffee date invitation\", I thought this might be a good candidate for demonstrating how I practice [Discovery Testing](https://github.com/testdouble/contributing-tests/wiki/Discovery-Testing) in Ruby. It forced me to figure out how to get isolated unit tests working in Rails 4+, which led me to write this blog post earlier this week: [Rake without Rails](http://blog.testdouble.com/posts/2016-12-15-rake-without-rails.html).\r\n\r\nNow that I can write unit tests, I've taken care to commit my work one logical step at a time and with messages to explain what on earth I'm doing. Here's what I've got so far.\r\n\r\n- [x] Step 1: break the problem down; details: f4b782a5eae98bd844171549fbec868e90eb37e4\r\n- [x] Step 2: create a value type to bridge ActiveRecord; details: b3ca074aa8589c3cdbff8124ee5d946bbe8df574\r\n- [x] Step 3: create a new database table; details: c11b08db25474a9fd8f95c3a8ebfe467b1a24a6f\r\n- [x] Step 4: write a query object for users; details: d1781cc230d0b5e693aba0fda0465bba02cf8315\r\n- [x] Step 5: match people up; details: 87b554cd2e039ea0e233ee0c6d768e47abd5dafe\r\n- [ ] Step 6: send the handshake pairing by mail \r\n- [ ] Step 7: persist the handshake occurred\r\n- [ ] Verify things work before merging","created_at":"2016-12-17T20:45:52Z","updated_at":"2016-12-18T02:35:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"350476d8e559c619b9ad90ee7a81becedc6bcb24","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/testdouble/present/pulls/128/commits","review_comments_url":"https://api.github.com/repos/testdouble/present/pulls/128/comments","review_comment_url":"https://api.github.com/repos/testdouble/present/pulls/comments{/number}","comments_url":"https://api.github.com/repos/testdouble/present/issues/128/comments","statuses_url":"https://api.github.com/repos/testdouble/present/statuses/87b554cd2e039ea0e233ee0c6d768e47abd5dafe","head":{"label":"testdouble:handshake-problem","ref":"handshake-problem","sha":"87b554cd2e039ea0e233ee0c6d768e47abd5dafe","user":{"login":"testdouble","id":1139195,"avatar_url":"https://avatars.githubusercontent.com/u/1139195?v=3","gravatar_id":"","url":"https://api.github.com/users/testdouble","html_url":"https://github.com/testdouble","followers_url":"https://api.github.com/users/testdouble/followers","following_url":"https://api.github.com/users/testdouble/following{/other_user}","gists_url":"https://api.github.com/users/testdouble/gists{/gist_id}","starred_url":"https://api.github.com/users/testdouble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testdouble/subscriptions","organizations_url":"https://api.github.com/users/testdouble/orgs","repos_url":"https://api.github.com/users/testdouble/repos","events_url":"https://api.github.com/users/testdouble/events{/privacy}","received_events_url":"https://api.github.com/users/testdouble/received_events","type":"Organization","site_admin":false},"repo":{"id":22366021,"name":"present","full_name":"testdouble/present","owner":{"login":"testdouble","id":1139195,"avatar_url":"https://avatars.githubusercontent.com/u/1139195?v=3","gravatar_id":"","url":"https://api.github.com/users/testdouble","html_url":"https://github.com/testdouble","followers_url":"https://api.github.com/users/testdouble/followers","following_url":"https://api.github.com/users/testdouble/following{/other_user}","gists_url":"https://api.github.com/users/testdouble/gists{/gist_id}","starred_url":"https://api.github.com/users/testdouble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testdouble/subscriptions","organizations_url":"https://api.github.com/users/testdouble/orgs","repos_url":"https://api.github.com/users/testdouble/repos","events_url":"https://api.github.com/users/testdouble/events{/privacy}","received_events_url":"https://api.github.com/users/testdouble/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/testdouble/present","description":"Activity Tracking for Test Double","fork":false,"url":"https://api.github.com/repos/testdouble/present","forks_url":"https://api.github.com/repos/testdouble/present/forks","keys_url":"https://api.github.com/repos/testdouble/present/keys{/key_id}","collaborators_url":"https://api.github.com/repos/testdouble/present/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/testdouble/present/teams","hooks_url":"https://api.github.com/repos/testdouble/present/hooks","issue_events_url":"https://api.github.com/repos/testdouble/present/issues/events{/number}","events_url":"https://api.github.com/repos/testdouble/present/events","assignees_url":"https://api.github.com/repos/testdouble/present/assignees{/user}","branches_url":"https://api.github.com/repos/testdouble/present/branches{/branch}","tags_url":"https://api.github.com/repos/testdouble/present/tags","blobs_url":"https://api.github.com/repos/testdouble/present/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/testdouble/present/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/testdouble/present/git/refs{/sha}","trees_url":"https://api.github.com/repos/testdouble/present/git/trees{/sha}","statuses_url":"https://api.github.com/repos/testdouble/present/statuses/{sha}","languages_url":"https://api.github.com/repos/testdouble/present/languages","stargazers_url":"https://api.github.com/repos/testdouble/present/stargazers","contributors_url":"https://api.github.com/repos/testdouble/present/contributors","subscribers_url":"https://api.github.com/repos/testdouble/present/subscribers","subscription_url":"https://api.github.com/repos/testdouble/present/subscription","commits_url":"https://api.github.com/repos/testdouble/present/commits{/sha}","git_commits_url":"https://api.github.com/repos/testdouble/present/git/commits{/sha}","comments_url":"https://api.github.com/repos/testdouble/present/comments{/number}","issue_comment_url":"https://api.github.com/repos/testdouble/present/issues/comments{/number}","contents_url":"https://api.github.com/repos/testdouble/present/contents/{+path}","compare_url":"https://api.github.com/repos/testdouble/present/compare/{base}...{head}","merges_url":"https://api.github.com/repos/testdouble/present/merges","archive_url":"https://api.github.com/repos/testdouble/present/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/testdouble/present/downloads","issues_url":"https://api.github.com/repos/testdouble/present/issues{/number}","pulls_url":"https://api.github.com/repos/testdouble/present/pulls{/number}","milestones_url":"https://api.github.com/repos/testdouble/present/milestones{/number}","notifications_url":"https://api.github.com/repos/testdouble/present/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/testdouble/present/labels{/name}","releases_url":"https://api.github.com/repos/testdouble/present/releases{/id}","deployments_url":"https://api.github.com/repos/testdouble/present/deployments","created_at":"2014-07-29T03:12:52Z","updated_at":"2016-12-15T17:28:32Z","pushed_at":"2016-12-17T20:50:50Z","git_url":"git://github.com/testdouble/present.git","ssh_url":"git@github.com:testdouble/present.git","clone_url":"https://github.com/testdouble/present.git","svn_url":"https://github.com/testdouble/present","homepage":null,"size":522,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":28,"forks":7,"open_issues":28,"watchers":13,"default_branch":"master"}},"base":{"label":"testdouble:master","ref":"master","sha":"b06f6ce21cc0841267f9d0010a11c0a8904ded97","user":{"login":"testdouble","id":1139195,"avatar_url":"https://avatars.githubusercontent.com/u/1139195?v=3","gravatar_id":"","url":"https://api.github.com/users/testdouble","html_url":"https://github.com/testdouble","followers_url":"https://api.github.com/users/testdouble/followers","following_url":"https://api.github.com/users/testdouble/following{/other_user}","gists_url":"https://api.github.com/users/testdouble/gists{/gist_id}","starred_url":"https://api.github.com/users/testdouble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testdouble/subscriptions","organizations_url":"https://api.github.com/users/testdouble/orgs","repos_url":"https://api.github.com/users/testdouble/repos","events_url":"https://api.github.com/users/testdouble/events{/privacy}","received_events_url":"https://api.github.com/users/testdouble/received_events","type":"Organization","site_admin":false},"repo":{"id":22366021,"name":"present","full_name":"testdouble/present","owner":{"login":"testdouble","id":1139195,"avatar_url":"https://avatars.githubusercontent.com/u/1139195?v=3","gravatar_id":"","url":"https://api.github.com/users/testdouble","html_url":"https://github.com/testdouble","followers_url":"https://api.github.com/users/testdouble/followers","following_url":"https://api.github.com/users/testdouble/following{/other_user}","gists_url":"https://api.github.com/users/testdouble/gists{/gist_id}","starred_url":"https://api.github.com/users/testdouble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testdouble/subscriptions","organizations_url":"https://api.github.com/users/testdouble/orgs","repos_url":"https://api.github.com/users/testdouble/repos","events_url":"https://api.github.com/users/testdouble/events{/privacy}","received_events_url":"https://api.github.com/users/testdouble/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/testdouble/present","description":"Activity Tracking for Test Double","fork":false,"url":"https://api.github.com/repos/testdouble/present","forks_url":"https://api.github.com/repos/testdouble/present/forks","keys_url":"https://api.github.com/repos/testdouble/present/keys{/key_id}","collaborators_url":"https://api.github.com/repos/testdouble/present/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/testdouble/present/teams","hooks_url":"https://api.github.com/repos/testdouble/present/hooks","issue_events_url":"https://api.github.com/repos/testdouble/present/issues/events{/number}","events_url":"https://api.github.com/repos/testdouble/present/events","assignees_url":"https://api.github.com/repos/testdouble/present/assignees{/user}","branches_url":"https://api.github.com/repos/testdouble/present/branches{/branch}","tags_url":"https://api.github.com/repos/testdouble/present/tags","blobs_url":"https://api.github.com/repos/testdouble/present/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/testdouble/present/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/testdouble/present/git/refs{/sha}","trees_url":"https://api.github.com/repos/testdouble/present/git/trees{/sha}","statuses_url":"https://api.github.com/repos/testdouble/present/statuses/{sha}","languages_url":"https://api.github.com/repos/testdouble/present/languages","stargazers_url":"https://api.github.com/repos/testdouble/present/stargazers","contributors_url":"https://api.github.com/repos/testdouble/present/contributors","subscribers_url":"https://api.github.com/repos/testdouble/present/subscribers","subscription_url":"https://api.github.com/repos/testdouble/present/subscription","commits_url":"https://api.github.com/repos/testdouble/present/commits{/sha}","git_commits_url":"https://api.github.com/repos/testdouble/present/git/commits{/sha}","comments_url":"https://api.github.com/repos/testdouble/present/comments{/number}","issue_comment_url":"https://api.github.com/repos/testdouble/present/issues/comments{/number}","contents_url":"https://api.github.com/repos/testdouble/present/contents/{+path}","compare_url":"https://api.github.com/repos/testdouble/present/compare/{base}...{head}","merges_url":"https://api.github.com/repos/testdouble/present/merges","archive_url":"https://api.github.com/repos/testdouble/present/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/testdouble/present/downloads","issues_url":"https://api.github.com/repos/testdouble/present/issues{/number}","pulls_url":"https://api.github.com/repos/testdouble/present/pulls{/number}","milestones_url":"https://api.github.com/repos/testdouble/present/milestones{/number}","notifications_url":"https://api.github.com/repos/testdouble/present/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/testdouble/present/labels{/name}","releases_url":"https://api.github.com/repos/testdouble/present/releases{/id}","deployments_url":"https://api.github.com/repos/testdouble/present/deployments","created_at":"2014-07-29T03:12:52Z","updated_at":"2016-12-15T17:28:32Z","pushed_at":"2016-12-17T20:50:50Z","git_url":"git://github.com/testdouble/present.git","ssh_url":"git@github.com:testdouble/present.git","clone_url":"https://github.com/testdouble/present.git","svn_url":"https://github.com/testdouble/present","homepage":null,"size":522,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":28,"forks":7,"open_issues":28,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/testdouble/present/pulls/128"},"html":{"href":"https://github.com/testdouble/present/pull/128"},"issue":{"href":"https://api.github.com/repos/testdouble/present/issues/128"},"comments":{"href":"https://api.github.com/repos/testdouble/present/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/testdouble/present/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/testdouble/present/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/testdouble/present/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/testdouble/present/statuses/87b554cd2e039ea0e233ee0c6d768e47abd5dafe"}}}}
{"actor":{"display_login":"stevenjackson"}}