{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments/39969633","id":39969633,"diff_hunk":"@@ -0,0 +1,85 @@\n+require 'sinatra/base'\n+require_relative 'lib/player'\n+require_relative 'lib/game'\n+require_relative 'lib/weapon'\n+\n+class RPS_Challenge < Sinatra::Base\n+\n+  set :views, proc { File.join(root, '.', 'views') }\n+\n+  enable :sessions\n+\n+  $game = nil\n+\n+  get '/' do\n+    @name = session[:name]\n+    erb :index\n+  end\n+\n+  post '/' do\n+    redirect ('/') if no_params_name\n+    session[:name] = params[:name]\n+    redirect ('/')\n+  end\n+\n+  post '/play_game' do\n+    if $game\n+      $game.reset_player_options\n+    else\n+      game_setup_vs_computer\n+    end\n+    if params[:opponent] == \"Buddy\"\n+      redirect ('/play_game_buddy')\n+    end\n+    redirect ('/play_game')\n+  end\n+\n+  get '/play_game' do\n+    erb :play_game\n+  end\n+\n+  get '/play_game_buddy' do\n+    erb :play_game_buddy\n+  end\n+\n+  post '/result' do\n+    arm_player_and_computer\n+    redirect ('/result')\n+  end\n+\n+  get '/result' do\n+    assign_name_weapon_vars\n+    @result = $game.challenge\n+    erb :result\n+  end\n+\n+  private\n+\n+  def game_setup_vs_computer\n+    player1 = Player.new\n+    player2 = Player.new\n+    player1.name = session[:name]\n+    player2.name = \"Computer\"\n+    $game = Game.new(player1,player2)\n+  end\n+\n+  def no_params_name\n+    params[:name].to_s == \"\"\n+  end\n+\n+  def arm_player_and_computer\n+    $game.player1.current_selection = Weapon.send(params[:weapon].downcase.to_sym)\n+    computer_option = [:rock, :paper, :scissors][rand(2)]\n+    $game.player2.current_selection = Weapon.send(computer_option)\n+  end\n+\n+  def assign_name_weapon_vars\n+    @name1 = $game.player1.name","path":"rps_web.rb","position":77,"original_position":77,"commit_id":"811d4a76cc3d7e153a6a68828ad098796e207f0a","original_commit_id":"811d4a76cc3d7e153a6a68828ad098796e207f0a","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Style/GlobalVars: Do not introduce global variables.","created_at":"2015-09-21T13:30:19Z","updated_at":"2015-09-21T13:30:19Z","html_url":"https://github.com/makersacademy/rps-challenge/pull/146#discussion_r39969633","pull_request_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments/39969633"},"html":{"href":"https://github.com/makersacademy/rps-challenge/pull/146#discussion_r39969633"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/146","id":45478819,"html_url":"https://github.com/makersacademy/rps-challenge/pull/146","diff_url":"https://github.com/makersacademy/rps-challenge/pull/146.diff","patch_url":"https://github.com/makersacademy/rps-challenge/pull/146.patch","issue_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/146","number":146,"state":"open","locked":false,"title":"Michael Roger - RPS Challenge","user":{"login":"Benaud12","id":12005992,"avatar_url":"https://avatars.githubusercontent.com/u/12005992?v=3","gravatar_id":"","url":"https://api.github.com/users/Benaud12","html_url":"https://github.com/Benaud12","followers_url":"https://api.github.com/users/Benaud12/followers","following_url":"https://api.github.com/users/Benaud12/following{/other_user}","gists_url":"https://api.github.com/users/Benaud12/gists{/gist_id}","starred_url":"https://api.github.com/users/Benaud12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Benaud12/subscriptions","organizations_url":"https://api.github.com/users/Benaud12/orgs","repos_url":"https://api.github.com/users/Benaud12/repos","events_url":"https://api.github.com/users/Benaud12/events{/privacy}","received_events_url":"https://api.github.com/users/Benaud12/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-19T15:44:32Z","updated_at":"2015-09-21T13:30:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd153c9134607ec7761952721cbb9d21ab5c187b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/146/commits","review_comments_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/146/comments","review_comment_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/146/comments","statuses_url":"https://api.github.com/repos/makersacademy/rps-challenge/statuses/811d4a76cc3d7e153a6a68828ad098796e207f0a","head":{"label":"Benaud12:master","ref":"master","sha":"811d4a76cc3d7e153a6a68828ad098796e207f0a","user":{"login":"Benaud12","id":12005992,"avatar_url":"https://avatars.githubusercontent.com/u/12005992?v=3","gravatar_id":"","url":"https://api.github.com/users/Benaud12","html_url":"https://github.com/Benaud12","followers_url":"https://api.github.com/users/Benaud12/followers","following_url":"https://api.github.com/users/Benaud12/following{/other_user}","gists_url":"https://api.github.com/users/Benaud12/gists{/gist_id}","starred_url":"https://api.github.com/users/Benaud12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Benaud12/subscriptions","organizations_url":"https://api.github.com/users/Benaud12/orgs","repos_url":"https://api.github.com/users/Benaud12/repos","events_url":"https://api.github.com/users/Benaud12/events{/privacy}","received_events_url":"https://api.github.com/users/Benaud12/received_events","type":"User","site_admin":false},"repo":{"id":42764834,"name":"rps-challenge","full_name":"Benaud12/rps-challenge","owner":{"login":"Benaud12","id":12005992,"avatar_url":"https://avatars.githubusercontent.com/u/12005992?v=3","gravatar_id":"","url":"https://api.github.com/users/Benaud12","html_url":"https://github.com/Benaud12","followers_url":"https://api.github.com/users/Benaud12/followers","following_url":"https://api.github.com/users/Benaud12/following{/other_user}","gists_url":"https://api.github.com/users/Benaud12/gists{/gist_id}","starred_url":"https://api.github.com/users/Benaud12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Benaud12/subscriptions","organizations_url":"https://api.github.com/users/Benaud12/orgs","repos_url":"https://api.github.com/users/Benaud12/repos","events_url":"https://api.github.com/users/Benaud12/events{/privacy}","received_events_url":"https://api.github.com/users/Benaud12/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Benaud12/rps-challenge","description":"Create the Rock Paper Scissors Game","fork":true,"url":"https://api.github.com/repos/Benaud12/rps-challenge","forks_url":"https://api.github.com/repos/Benaud12/rps-challenge/forks","keys_url":"https://api.github.com/repos/Benaud12/rps-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Benaud12/rps-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Benaud12/rps-challenge/teams","hooks_url":"https://api.github.com/repos/Benaud12/rps-challenge/hooks","issue_events_url":"https://api.github.com/repos/Benaud12/rps-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/Benaud12/rps-challenge/events","assignees_url":"https://api.github.com/repos/Benaud12/rps-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/Benaud12/rps-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/Benaud12/rps-challenge/tags","blobs_url":"https://api.github.com/repos/Benaud12/rps-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Benaud12/rps-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Benaud12/rps-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/Benaud12/rps-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Benaud12/rps-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/Benaud12/rps-challenge/languages","stargazers_url":"https://api.github.com/repos/Benaud12/rps-challenge/stargazers","contributors_url":"https://api.github.com/repos/Benaud12/rps-challenge/contributors","subscribers_url":"https://api.github.com/repos/Benaud12/rps-challenge/subscribers","subscription_url":"https://api.github.com/repos/Benaud12/rps-challenge/subscription","commits_url":"https://api.github.com/repos/Benaud12/rps-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/Benaud12/rps-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/Benaud12/rps-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/Benaud12/rps-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/Benaud12/rps-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/Benaud12/rps-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Benaud12/rps-challenge/merges","archive_url":"https://api.github.com/repos/Benaud12/rps-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Benaud12/rps-challenge/downloads","issues_url":"https://api.github.com/repos/Benaud12/rps-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/Benaud12/rps-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/Benaud12/rps-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/Benaud12/rps-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Benaud12/rps-challenge/labels{/name}","releases_url":"https://api.github.com/repos/Benaud12/rps-challenge/releases{/id}","created_at":"2015-09-19T07:54:04Z","updated_at":"2015-09-19T07:54:05Z","pushed_at":"2015-09-21T13:30:14Z","git_url":"git://github.com/Benaud12/rps-challenge.git","ssh_url":"git@github.com:Benaud12/rps-challenge.git","clone_url":"https://github.com/Benaud12/rps-challenge.git","svn_url":"https://github.com/Benaud12/rps-challenge","homepage":null,"size":137,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"makersacademy:master","ref":"master","sha":"cbb82df47ab9b711d20b47c7c9bd12855d465bb1","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":27006066,"name":"rps-challenge","full_name":"makersacademy/rps-challenge","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/rps-challenge","description":"Create the Rock Paper Scissors Game","fork":false,"url":"https://api.github.com/repos/makersacademy/rps-challenge","forks_url":"https://api.github.com/repos/makersacademy/rps-challenge/forks","keys_url":"https://api.github.com/repos/makersacademy/rps-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/rps-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/rps-challenge/teams","hooks_url":"https://api.github.com/repos/makersacademy/rps-challenge/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/rps-challenge/events","assignees_url":"https://api.github.com/repos/makersacademy/rps-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/rps-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/rps-challenge/tags","blobs_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/rps-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/rps-challenge/languages","stargazers_url":"https://api.github.com/repos/makersacademy/rps-challenge/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/rps-challenge/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/rps-challenge/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/rps-challenge/subscription","commits_url":"https://api.github.com/repos/makersacademy/rps-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/rps-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/rps-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/rps-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/rps-challenge/merges","archive_url":"https://api.github.com/repos/makersacademy/rps-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/rps-challenge/downloads","issues_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/rps-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/rps-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/rps-challenge/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/rps-challenge/releases{/id}","created_at":"2014-11-22T17:15:17Z","updated_at":"2015-04-02T19:30:46Z","pushed_at":"2015-09-21T13:30:14Z","git_url":"git://github.com/makersacademy/rps-challenge.git","ssh_url":"git@github.com:makersacademy/rps-challenge.git","clone_url":"https://github.com/makersacademy/rps-challenge.git","svn_url":"https://github.com/makersacademy/rps-challenge","homepage":null,"size":78105,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":172,"mirror_url":null,"open_issues_count":34,"forks":172,"open_issues":34,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/146"},"html":{"href":"https://github.com/makersacademy/rps-challenge/pull/146"},"issue":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/issues/146"},"comments":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/statuses/811d4a76cc3d7e153a6a68828ad098796e207f0a"}}}}