{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments/52889807","id":52889807,"diff_hunk":"@@ -0,0 +1,90 @@\n+ENV[\"RACK_ENV\"] ||= \"development\"\n+\n+require 'sinatra/base'\n+require_relative 'data_mapper_setup'\n+require_relative 'models/chitter'\n+require 'sinatra/flash'\n+\n+\n+class Chitter < Sinatra::Base\n+\n+  use Rack::MethodOverride\n+\n+  enable :sessions\n+  set :session_secret, 'super secret'\n+  set :partial_template_engine, :erb\n+  set :public_folder, Proc.new { File.join(root, 'static') }\n+\n+  enable :partial_underscores\n+\n+  register Sinatra::Flash\n+  #\n+\n+  get '/chits' do\n+    @chits = Chit.all\n+    erb :'chits/index'\n+  end\n+\n+  get '/chits/new' do \n+    erb :'chits/new'\n+  end\n+\n+  post '/chits' do\n+    Chit.create(chitter_post: params[:chitter_post], user: params[:user])\n+    redirect to('/chits')\n+  end\n+\n+  get '/users/new' do\n+    @user = User.new\n+    erb :'users/new'\n+  end\n+\n+  post '/users' do\n+    @user = User.create(email: params[:email],\n+                     password: params[:password], \n+                     password_confirmation: params[:password_confirmation])\n+\n+    if @user.save\n+  session[:user_id] = @user.id\n+  redirect to('/chits')\n+else\n+  flash.now[:errors] = @user.errors.full_messages\n+  erb :'users/new'\n+end\n+  end\n+\n+  helpers do\n+    def current_user\n+   @current_user ||= User.get(session[:user_id])\n+  end\n+\n+  get '/sessions/new' do\n+    erb :'sessions/new'\n+  end\n+\n+post '/sessions' do\n+  user = User.authenticate(params[:email], params[:password])\n+  if user\n+    session[:user_id] = user.id\n+    redirect to('/chits')\n+  else\n+    flash.now[:errors] = ['The email or password is incorrect']\n+    erb :'sessions/new'\n+  end\n+end\n+\n+delete '/sessions' do\n+  session[:user_id] = nil\n+  flash.keep[:notice] = 'goodbye!'\n+  redirect to '/chits'\n+end\n+\n+ get '/users/recover' do\n+    \"Please enter your email address\"\n+  end\n+\n+\n+\n+  run! if app_file == $0","path":"app/app.rb","position":88,"original_position":88,"commit_id":"7c09bcda15f33a929cd7a26a85cc94dc66ac77b6","original_commit_id":"7c09bcda15f33a929cd7a26a85cc94dc66ac77b6","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Style/SpecialGlobalVars: Prefer `$PROGRAM_NAME` over `$0`. (https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms)","created_at":"2016-02-15T11:48:52Z","updated_at":"2016-02-15T11:48:52Z","html_url":"https://github.com/makersacademy/chitter-challenge/pull/272#discussion_r52889807","pull_request_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/272","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments/52889807"},"html":{"href":"https://github.com/makersacademy/chitter-challenge/pull/272#discussion_r52889807"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/272"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/272","id":59311320,"html_url":"https://github.com/makersacademy/chitter-challenge/pull/272","diff_url":"https://github.com/makersacademy/chitter-challenge/pull/272.diff","patch_url":"https://github.com/makersacademy/chitter-challenge/pull/272.patch","issue_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/272","number":272,"state":"open","locked":false,"title":"Chitter-challenge","user":{"login":"frazerWatson","id":15121967,"avatar_url":"https://avatars.githubusercontent.com/u/15121967?v=3","gravatar_id":"","url":"https://api.github.com/users/frazerWatson","html_url":"https://github.com/frazerWatson","followers_url":"https://api.github.com/users/frazerWatson/followers","following_url":"https://api.github.com/users/frazerWatson/following{/other_user}","gists_url":"https://api.github.com/users/frazerWatson/gists{/gist_id}","starred_url":"https://api.github.com/users/frazerWatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frazerWatson/subscriptions","organizations_url":"https://api.github.com/users/frazerWatson/orgs","repos_url":"https://api.github.com/users/frazerWatson/repos","events_url":"https://api.github.com/users/frazerWatson/events{/privacy}","received_events_url":"https://api.github.com/users/frazerWatson/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-15T00:30:29Z","updated_at":"2016-02-15T11:48:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7824ca288cf6e4a1a437574ae8f0f46050155b6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/272/commits","review_comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/272/comments","review_comment_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/272/comments","statuses_url":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/7c09bcda15f33a929cd7a26a85cc94dc66ac77b6","head":{"label":"frazerWatson:master","ref":"master","sha":"7c09bcda15f33a929cd7a26a85cc94dc66ac77b6","user":{"login":"frazerWatson","id":15121967,"avatar_url":"https://avatars.githubusercontent.com/u/15121967?v=3","gravatar_id":"","url":"https://api.github.com/users/frazerWatson","html_url":"https://github.com/frazerWatson","followers_url":"https://api.github.com/users/frazerWatson/followers","following_url":"https://api.github.com/users/frazerWatson/following{/other_user}","gists_url":"https://api.github.com/users/frazerWatson/gists{/gist_id}","starred_url":"https://api.github.com/users/frazerWatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frazerWatson/subscriptions","organizations_url":"https://api.github.com/users/frazerWatson/orgs","repos_url":"https://api.github.com/users/frazerWatson/repos","events_url":"https://api.github.com/users/frazerWatson/events{/privacy}","received_events_url":"https://api.github.com/users/frazerWatson/received_events","type":"User","site_admin":false},"repo":{"id":51675971,"name":"chitter-challenge","full_name":"frazerWatson/chitter-challenge","owner":{"login":"frazerWatson","id":15121967,"avatar_url":"https://avatars.githubusercontent.com/u/15121967?v=3","gravatar_id":"","url":"https://api.github.com/users/frazerWatson","html_url":"https://github.com/frazerWatson","followers_url":"https://api.github.com/users/frazerWatson/followers","following_url":"https://api.github.com/users/frazerWatson/following{/other_user}","gists_url":"https://api.github.com/users/frazerWatson/gists{/gist_id}","starred_url":"https://api.github.com/users/frazerWatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frazerWatson/subscriptions","organizations_url":"https://api.github.com/users/frazerWatson/orgs","repos_url":"https://api.github.com/users/frazerWatson/repos","events_url":"https://api.github.com/users/frazerWatson/events{/privacy}","received_events_url":"https://api.github.com/users/frazerWatson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frazerWatson/chitter-challenge","description":"Build a Twitter Clone!","fork":true,"url":"https://api.github.com/repos/frazerWatson/chitter-challenge","forks_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/forks","keys_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/teams","hooks_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/hooks","issue_events_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/events","assignees_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/tags","blobs_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/languages","stargazers_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/stargazers","contributors_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/contributors","subscribers_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/subscribers","subscription_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/subscription","commits_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/merges","archive_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/downloads","issues_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/labels{/name}","releases_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/releases{/id}","deployments_url":"https://api.github.com/repos/frazerWatson/chitter-challenge/deployments","created_at":"2016-02-14T02:23:15Z","updated_at":"2016-02-14T02:23:16Z","pushed_at":"2016-02-15T11:48:44Z","git_url":"git://github.com/frazerWatson/chitter-challenge.git","ssh_url":"git@github.com:frazerWatson/chitter-challenge.git","clone_url":"https://github.com/frazerWatson/chitter-challenge.git","svn_url":"https://github.com/frazerWatson/chitter-challenge","homepage":null,"size":78,"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":"1ec1413865ab4e5dd0990904025289af31194cc3","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":26954706,"name":"chitter-challenge","full_name":"makersacademy/chitter-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/chitter-challenge","description":"Build a Twitter Clone!","fork":false,"url":"https://api.github.com/repos/makersacademy/chitter-challenge","forks_url":"https://api.github.com/repos/makersacademy/chitter-challenge/forks","keys_url":"https://api.github.com/repos/makersacademy/chitter-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/chitter-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/chitter-challenge/teams","hooks_url":"https://api.github.com/repos/makersacademy/chitter-challenge/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/chitter-challenge/events","assignees_url":"https://api.github.com/repos/makersacademy/chitter-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/chitter-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/chitter-challenge/tags","blobs_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/chitter-challenge/languages","stargazers_url":"https://api.github.com/repos/makersacademy/chitter-challenge/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/chitter-challenge/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/chitter-challenge/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/chitter-challenge/subscription","commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/chitter-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/chitter-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/chitter-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/chitter-challenge/merges","archive_url":"https://api.github.com/repos/makersacademy/chitter-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/chitter-challenge/downloads","issues_url":"https://api.github.com/repos/makersacademy/chitter-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/chitter-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/chitter-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/chitter-challenge/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/chitter-challenge/releases{/id}","deployments_url":"https://api.github.com/repos/makersacademy/chitter-challenge/deployments","created_at":"2014-11-21T09:53:31Z","updated_at":"2016-02-12T17:12:06Z","pushed_at":"2016-02-15T11:48:45Z","git_url":"git://github.com/makersacademy/chitter-challenge.git","ssh_url":"git@github.com:makersacademy/chitter-challenge.git","clone_url":"https://github.com/makersacademy/chitter-challenge.git","svn_url":"https://github.com/makersacademy/chitter-challenge","homepage":null,"size":48835,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":277,"mirror_url":null,"open_issues_count":46,"forks":277,"open_issues":46,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/272"},"html":{"href":"https://github.com/makersacademy/chitter-challenge/pull/272"},"issue":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/272"},"comments":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/issues/272/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/272/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/pulls/272/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/chitter-challenge/statuses/7c09bcda15f33a929cd7a26a85cc94dc66ac77b6"}}}}