{"action":"created","comment":{"url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/comments/79307399","id":79307399,"diff_hunk":"@@ -1,68 +1,71 @@\n+require 'yaml'\n+\n class CliInterface\n   attr_accessor :input\n   attr_accessor :output\n \n   def initialize(input, output)\n     @input = input\n     @output = output\n+    @file = YAML::load(File.open('en_text.yml'))\n   end\n \n   def display_board(board)\n     board.each { |line| display_line(line) }\n   end\n \n   def next_move(mark)\n-    output.print(\"#{mark} what is your next move? \")\n+    output.print(\"#{mark} #{@file['next_move']} \")\n     input.gets\n   end\n \n   def type_game\n-    output.print(\"Which game do you want?\\n\")\n+    output.puts(\"#{@file['which_game']}\")","path":"lib/cli_interface.rb","position":25,"original_position":25,"commit_id":"246b610cad4d43a1825678a13801f5074fe45dcc","original_commit_id":"246b610cad4d43a1825678a13801f5074fe45dcc","user":{"login":"gemcfadyen","id":1843633,"avatar_url":"https://avatars.githubusercontent.com/u/1843633?v=3","gravatar_id":"","url":"https://api.github.com/users/gemcfadyen","html_url":"https://github.com/gemcfadyen","followers_url":"https://api.github.com/users/gemcfadyen/followers","following_url":"https://api.github.com/users/gemcfadyen/following{/other_user}","gists_url":"https://api.github.com/users/gemcfadyen/gists{/gist_id}","starred_url":"https://api.github.com/users/gemcfadyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemcfadyen/subscriptions","organizations_url":"https://api.github.com/users/gemcfadyen/orgs","repos_url":"https://api.github.com/users/gemcfadyen/repos","events_url":"https://api.github.com/users/gemcfadyen/events{/privacy}","received_events_url":"https://api.github.com/users/gemcfadyen/received_events","type":"User","site_admin":false},"body":"There is a lot of duplication amongst the methods in this file. Can you extract out the `output.puts('some_key')` into a method then just call it in each one. Eg: `display('which_game')    display('not_free')`","created_at":"2016-09-18T14:45:57Z","updated_at":"2016-09-18T14:53:49Z","html_url":"https://github.com/fabientownsend/tic-tac-toe/pull/1#discussion_r79307399","pull_request_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/comments/79307399"},"html":{"href":"https://github.com/fabientownsend/tic-tac-toe/pull/1#discussion_r79307399"},"pull_request":{"href":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/1","id":85593861,"html_url":"https://github.com/fabientownsend/tic-tac-toe/pull/1","diff_url":"https://github.com/fabientownsend/tic-tac-toe/pull/1.diff","patch_url":"https://github.com/fabientownsend/tic-tac-toe/pull/1.patch","issue_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues/1","number":1,"state":"open","locked":false,"title":"Refactorisation of the project","user":{"login":"fabientownsend","id":2458181,"avatar_url":"https://avatars.githubusercontent.com/u/2458181?v=3","gravatar_id":"","url":"https://api.github.com/users/fabientownsend","html_url":"https://github.com/fabientownsend","followers_url":"https://api.github.com/users/fabientownsend/followers","following_url":"https://api.github.com/users/fabientownsend/following{/other_user}","gists_url":"https://api.github.com/users/fabientownsend/gists{/gist_id}","starred_url":"https://api.github.com/users/fabientownsend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabientownsend/subscriptions","organizations_url":"https://api.github.com/users/fabientownsend/orgs","repos_url":"https://api.github.com/users/fabientownsend/repos","events_url":"https://api.github.com/users/fabientownsend/events{/privacy}","received_events_url":"https://api.github.com/users/fabientownsend/received_events","type":"User","site_admin":false},"body":"Externalization of the next.\r\nAttempt to get rid of the magic numbers\r\nSimplification of the tests (mostly board tests)","created_at":"2016-09-16T15:31:34Z","updated_at":"2016-09-18T14:53:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ee38d8cf55f808249782d513076300018f3c592","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/1/commits","review_comments_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/1/comments","review_comment_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues/1/comments","statuses_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/statuses/246b610cad4d43a1825678a13801f5074fe45dcc","head":{"label":"fabientownsend:refactor","ref":"refactor","sha":"246b610cad4d43a1825678a13801f5074fe45dcc","user":{"login":"fabientownsend","id":2458181,"avatar_url":"https://avatars.githubusercontent.com/u/2458181?v=3","gravatar_id":"","url":"https://api.github.com/users/fabientownsend","html_url":"https://github.com/fabientownsend","followers_url":"https://api.github.com/users/fabientownsend/followers","following_url":"https://api.github.com/users/fabientownsend/following{/other_user}","gists_url":"https://api.github.com/users/fabientownsend/gists{/gist_id}","starred_url":"https://api.github.com/users/fabientownsend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabientownsend/subscriptions","organizations_url":"https://api.github.com/users/fabientownsend/orgs","repos_url":"https://api.github.com/users/fabientownsend/repos","events_url":"https://api.github.com/users/fabientownsend/events{/privacy}","received_events_url":"https://api.github.com/users/fabientownsend/received_events","type":"User","site_admin":false},"repo":{"id":67703835,"name":"tic-tac-toe","full_name":"fabientownsend/tic-tac-toe","owner":{"login":"fabientownsend","id":2458181,"avatar_url":"https://avatars.githubusercontent.com/u/2458181?v=3","gravatar_id":"","url":"https://api.github.com/users/fabientownsend","html_url":"https://github.com/fabientownsend","followers_url":"https://api.github.com/users/fabientownsend/followers","following_url":"https://api.github.com/users/fabientownsend/following{/other_user}","gists_url":"https://api.github.com/users/fabientownsend/gists{/gist_id}","starred_url":"https://api.github.com/users/fabientownsend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabientownsend/subscriptions","organizations_url":"https://api.github.com/users/fabientownsend/orgs","repos_url":"https://api.github.com/users/fabientownsend/repos","events_url":"https://api.github.com/users/fabientownsend/events{/privacy}","received_events_url":"https://api.github.com/users/fabientownsend/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabientownsend/tic-tac-toe","description":null,"fork":false,"url":"https://api.github.com/repos/fabientownsend/tic-tac-toe","forks_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/forks","keys_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/teams","hooks_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/hooks","issue_events_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues/events{/number}","events_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/events","assignees_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/assignees{/user}","branches_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/branches{/branch}","tags_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/tags","blobs_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/statuses/{sha}","languages_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/languages","stargazers_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/stargazers","contributors_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/contributors","subscribers_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/subscribers","subscription_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/subscription","commits_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/contents/{+path}","compare_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/merges","archive_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/downloads","issues_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues{/number}","pulls_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls{/number}","milestones_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/milestones{/number}","notifications_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/labels{/name}","releases_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/releases{/id}","deployments_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/deployments","created_at":"2016-09-08T13:05:42Z","updated_at":"2016-09-08T13:12:23Z","pushed_at":"2016-09-16T16:18:12Z","git_url":"git://github.com/fabientownsend/tic-tac-toe.git","ssh_url":"git@github.com:fabientownsend/tic-tac-toe.git","clone_url":"https://github.com/fabientownsend/tic-tac-toe.git","svn_url":"https://github.com/fabientownsend/tic-tac-toe","homepage":null,"size":49,"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":"fabientownsend:master","ref":"master","sha":"e25b5506a2948b12ea92fe55d96a54c57c9bf253","user":{"login":"fabientownsend","id":2458181,"avatar_url":"https://avatars.githubusercontent.com/u/2458181?v=3","gravatar_id":"","url":"https://api.github.com/users/fabientownsend","html_url":"https://github.com/fabientownsend","followers_url":"https://api.github.com/users/fabientownsend/followers","following_url":"https://api.github.com/users/fabientownsend/following{/other_user}","gists_url":"https://api.github.com/users/fabientownsend/gists{/gist_id}","starred_url":"https://api.github.com/users/fabientownsend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabientownsend/subscriptions","organizations_url":"https://api.github.com/users/fabientownsend/orgs","repos_url":"https://api.github.com/users/fabientownsend/repos","events_url":"https://api.github.com/users/fabientownsend/events{/privacy}","received_events_url":"https://api.github.com/users/fabientownsend/received_events","type":"User","site_admin":false},"repo":{"id":67703835,"name":"tic-tac-toe","full_name":"fabientownsend/tic-tac-toe","owner":{"login":"fabientownsend","id":2458181,"avatar_url":"https://avatars.githubusercontent.com/u/2458181?v=3","gravatar_id":"","url":"https://api.github.com/users/fabientownsend","html_url":"https://github.com/fabientownsend","followers_url":"https://api.github.com/users/fabientownsend/followers","following_url":"https://api.github.com/users/fabientownsend/following{/other_user}","gists_url":"https://api.github.com/users/fabientownsend/gists{/gist_id}","starred_url":"https://api.github.com/users/fabientownsend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabientownsend/subscriptions","organizations_url":"https://api.github.com/users/fabientownsend/orgs","repos_url":"https://api.github.com/users/fabientownsend/repos","events_url":"https://api.github.com/users/fabientownsend/events{/privacy}","received_events_url":"https://api.github.com/users/fabientownsend/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabientownsend/tic-tac-toe","description":null,"fork":false,"url":"https://api.github.com/repos/fabientownsend/tic-tac-toe","forks_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/forks","keys_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/teams","hooks_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/hooks","issue_events_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues/events{/number}","events_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/events","assignees_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/assignees{/user}","branches_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/branches{/branch}","tags_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/tags","blobs_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/statuses/{sha}","languages_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/languages","stargazers_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/stargazers","contributors_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/contributors","subscribers_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/subscribers","subscription_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/subscription","commits_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/contents/{+path}","compare_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/merges","archive_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/downloads","issues_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues{/number}","pulls_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls{/number}","milestones_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/milestones{/number}","notifications_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/labels{/name}","releases_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/releases{/id}","deployments_url":"https://api.github.com/repos/fabientownsend/tic-tac-toe/deployments","created_at":"2016-09-08T13:05:42Z","updated_at":"2016-09-08T13:12:23Z","pushed_at":"2016-09-16T16:18:12Z","git_url":"git://github.com/fabientownsend/tic-tac-toe.git","ssh_url":"git@github.com:fabientownsend/tic-tac-toe.git","clone_url":"https://github.com/fabientownsend/tic-tac-toe.git","svn_url":"https://github.com/fabientownsend/tic-tac-toe","homepage":null,"size":49,"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/fabientownsend/tic-tac-toe/pulls/1"},"html":{"href":"https://github.com/fabientownsend/tic-tac-toe/pull/1"},"issue":{"href":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues/1"},"comments":{"href":"https://api.github.com/repos/fabientownsend/tic-tac-toe/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fabientownsend/tic-tac-toe/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/fabientownsend/tic-tac-toe/statuses/246b610cad4d43a1825678a13801f5074fe45dcc"}}}}
{"actor":{"display_login":"gemcfadyen"}}