{"action":"created","comment":{"url":"https://api.github.com/repos/Snieezy/store/pulls/comments/70568400","id":70568400,"diff_hunk":"@@ -0,0 +1,33 @@\n+require \"sinatra/base\"\n+\n+require_relative \"lib/warehouse\"\n+require_relative \"lib/basket\"\n+\n+$basket = Basket.new\n+$warehouse = Warehouse.new\n+\n+class App < Sinatra::Base\n+\n+  get \"/\" do\n+    erb :index\n+  end\n+\n+  get \"/:id\" do\n+    @product = $warehouse.get_product_by_id(params[:id].to_i)\n+    erb :product\n+  end\n+\n+  post \"/:id/buy\" do\n+    @product = $warehouse.get_product_by_id(params[:id].to_i)\n+    begin\n+      $basket.add_product($warehouse, params[:id].to_i, params[:amount].to_i)\n+      @result = \"bought\"\n+      redirect \"/\"\n+    rescue InvalidIDError\n+      @result = \"wrong id\"\n+    rescue InvalidQuantityError\n+      @result = \"wrong amount\"\n+    end\n+    erb :buy\n+  end\n+end","path":"app.rb~","position":33,"original_position":33,"commit_id":"1e1146e2a630d2e9072095ae550accca482d15c7","original_commit_id":"1e1146e2a630d2e9072095ae550accca482d15c7","user":{"login":"gotar","id":135318,"avatar_url":"https://avatars.githubusercontent.com/u/135318?v=3","gravatar_id":"","url":"https://api.github.com/users/gotar","html_url":"https://github.com/gotar","followers_url":"https://api.github.com/users/gotar/followers","following_url":"https://api.github.com/users/gotar/following{/other_user}","gists_url":"https://api.github.com/users/gotar/gists{/gist_id}","starred_url":"https://api.github.com/users/gotar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gotar/subscriptions","organizations_url":"https://api.github.com/users/gotar/orgs","repos_url":"https://api.github.com/users/gotar/repos","events_url":"https://api.github.com/users/gotar/events{/privacy}","received_events_url":"https://api.github.com/users/gotar/received_events","type":"User","site_admin":false},"body":"drop whole tmp file (add to your gitignore: *~)\r\n","created_at":"2016-07-13T06:06:33Z","updated_at":"2016-07-13T06:06:33Z","html_url":"https://github.com/Snieezy/store/pull/2#discussion_r70568400","pull_request_url":"https://api.github.com/repos/Snieezy/store/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Snieezy/store/pulls/comments/70568400"},"html":{"href":"https://github.com/Snieezy/store/pull/2#discussion_r70568400"},"pull_request":{"href":"https://api.github.com/repos/Snieezy/store/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Snieezy/store/pulls/2","id":77197108,"html_url":"https://github.com/Snieezy/store/pull/2","diff_url":"https://github.com/Snieezy/store/pull/2.diff","patch_url":"https://github.com/Snieezy/store/pull/2.patch","issue_url":"https://api.github.com/repos/Snieezy/store/issues/2","number":2,"state":"open","locked":false,"title":"Web","user":{"login":"Snieezy","id":20272578,"avatar_url":"https://avatars.githubusercontent.com/u/20272578?v=3","gravatar_id":"","url":"https://api.github.com/users/Snieezy","html_url":"https://github.com/Snieezy","followers_url":"https://api.github.com/users/Snieezy/followers","following_url":"https://api.github.com/users/Snieezy/following{/other_user}","gists_url":"https://api.github.com/users/Snieezy/gists{/gist_id}","starred_url":"https://api.github.com/users/Snieezy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snieezy/subscriptions","organizations_url":"https://api.github.com/users/Snieezy/orgs","repos_url":"https://api.github.com/users/Snieezy/repos","events_url":"https://api.github.com/users/Snieezy/events{/privacy}","received_events_url":"https://api.github.com/users/Snieezy/received_events","type":"User","site_admin":false},"body":"All basic features should work. There are some leftovers from previous version (before model/service)...to be continued.","created_at":"2016-07-12T21:44:17Z","updated_at":"2016-07-13T06:06:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6a2d2de013ee49c48dc11de97b4bb4c03489fd4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Snieezy/store/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Snieezy/store/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Snieezy/store/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Snieezy/store/issues/2/comments","statuses_url":"https://api.github.com/repos/Snieezy/store/statuses/1e1146e2a630d2e9072095ae550accca482d15c7","head":{"label":"Snieezy:web","ref":"web","sha":"1e1146e2a630d2e9072095ae550accca482d15c7","user":{"login":"Snieezy","id":20272578,"avatar_url":"https://avatars.githubusercontent.com/u/20272578?v=3","gravatar_id":"","url":"https://api.github.com/users/Snieezy","html_url":"https://github.com/Snieezy","followers_url":"https://api.github.com/users/Snieezy/followers","following_url":"https://api.github.com/users/Snieezy/following{/other_user}","gists_url":"https://api.github.com/users/Snieezy/gists{/gist_id}","starred_url":"https://api.github.com/users/Snieezy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snieezy/subscriptions","organizations_url":"https://api.github.com/users/Snieezy/orgs","repos_url":"https://api.github.com/users/Snieezy/repos","events_url":"https://api.github.com/users/Snieezy/events{/privacy}","received_events_url":"https://api.github.com/users/Snieezy/received_events","type":"User","site_admin":false},"repo":{"id":62730345,"name":"store","full_name":"Snieezy/store","owner":{"login":"Snieezy","id":20272578,"avatar_url":"https://avatars.githubusercontent.com/u/20272578?v=3","gravatar_id":"","url":"https://api.github.com/users/Snieezy","html_url":"https://github.com/Snieezy","followers_url":"https://api.github.com/users/Snieezy/followers","following_url":"https://api.github.com/users/Snieezy/following{/other_user}","gists_url":"https://api.github.com/users/Snieezy/gists{/gist_id}","starred_url":"https://api.github.com/users/Snieezy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snieezy/subscriptions","organizations_url":"https://api.github.com/users/Snieezy/orgs","repos_url":"https://api.github.com/users/Snieezy/repos","events_url":"https://api.github.com/users/Snieezy/events{/privacy}","received_events_url":"https://api.github.com/users/Snieezy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Snieezy/store","description":null,"fork":false,"url":"https://api.github.com/repos/Snieezy/store","forks_url":"https://api.github.com/repos/Snieezy/store/forks","keys_url":"https://api.github.com/repos/Snieezy/store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Snieezy/store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Snieezy/store/teams","hooks_url":"https://api.github.com/repos/Snieezy/store/hooks","issue_events_url":"https://api.github.com/repos/Snieezy/store/issues/events{/number}","events_url":"https://api.github.com/repos/Snieezy/store/events","assignees_url":"https://api.github.com/repos/Snieezy/store/assignees{/user}","branches_url":"https://api.github.com/repos/Snieezy/store/branches{/branch}","tags_url":"https://api.github.com/repos/Snieezy/store/tags","blobs_url":"https://api.github.com/repos/Snieezy/store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Snieezy/store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Snieezy/store/git/refs{/sha}","trees_url":"https://api.github.com/repos/Snieezy/store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Snieezy/store/statuses/{sha}","languages_url":"https://api.github.com/repos/Snieezy/store/languages","stargazers_url":"https://api.github.com/repos/Snieezy/store/stargazers","contributors_url":"https://api.github.com/repos/Snieezy/store/contributors","subscribers_url":"https://api.github.com/repos/Snieezy/store/subscribers","subscription_url":"https://api.github.com/repos/Snieezy/store/subscription","commits_url":"https://api.github.com/repos/Snieezy/store/commits{/sha}","git_commits_url":"https://api.github.com/repos/Snieezy/store/git/commits{/sha}","comments_url":"https://api.github.com/repos/Snieezy/store/comments{/number}","issue_comment_url":"https://api.github.com/repos/Snieezy/store/issues/comments{/number}","contents_url":"https://api.github.com/repos/Snieezy/store/contents/{+path}","compare_url":"https://api.github.com/repos/Snieezy/store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Snieezy/store/merges","archive_url":"https://api.github.com/repos/Snieezy/store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Snieezy/store/downloads","issues_url":"https://api.github.com/repos/Snieezy/store/issues{/number}","pulls_url":"https://api.github.com/repos/Snieezy/store/pulls{/number}","milestones_url":"https://api.github.com/repos/Snieezy/store/milestones{/number}","notifications_url":"https://api.github.com/repos/Snieezy/store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Snieezy/store/labels{/name}","releases_url":"https://api.github.com/repos/Snieezy/store/releases{/id}","deployments_url":"https://api.github.com/repos/Snieezy/store/deployments","created_at":"2016-07-06T15:07:00Z","updated_at":"2016-07-06T15:11:39Z","pushed_at":"2016-07-12T23:06:03Z","git_url":"git://github.com/Snieezy/store.git","ssh_url":"git@github.com:Snieezy/store.git","clone_url":"https://github.com/Snieezy/store.git","svn_url":"https://github.com/Snieezy/store","homepage":null,"size":54,"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":"Snieezy:master","ref":"master","sha":"7340091489afb475ef92afe677edd0811e8610f0","user":{"login":"Snieezy","id":20272578,"avatar_url":"https://avatars.githubusercontent.com/u/20272578?v=3","gravatar_id":"","url":"https://api.github.com/users/Snieezy","html_url":"https://github.com/Snieezy","followers_url":"https://api.github.com/users/Snieezy/followers","following_url":"https://api.github.com/users/Snieezy/following{/other_user}","gists_url":"https://api.github.com/users/Snieezy/gists{/gist_id}","starred_url":"https://api.github.com/users/Snieezy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snieezy/subscriptions","organizations_url":"https://api.github.com/users/Snieezy/orgs","repos_url":"https://api.github.com/users/Snieezy/repos","events_url":"https://api.github.com/users/Snieezy/events{/privacy}","received_events_url":"https://api.github.com/users/Snieezy/received_events","type":"User","site_admin":false},"repo":{"id":62730345,"name":"store","full_name":"Snieezy/store","owner":{"login":"Snieezy","id":20272578,"avatar_url":"https://avatars.githubusercontent.com/u/20272578?v=3","gravatar_id":"","url":"https://api.github.com/users/Snieezy","html_url":"https://github.com/Snieezy","followers_url":"https://api.github.com/users/Snieezy/followers","following_url":"https://api.github.com/users/Snieezy/following{/other_user}","gists_url":"https://api.github.com/users/Snieezy/gists{/gist_id}","starred_url":"https://api.github.com/users/Snieezy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snieezy/subscriptions","organizations_url":"https://api.github.com/users/Snieezy/orgs","repos_url":"https://api.github.com/users/Snieezy/repos","events_url":"https://api.github.com/users/Snieezy/events{/privacy}","received_events_url":"https://api.github.com/users/Snieezy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Snieezy/store","description":null,"fork":false,"url":"https://api.github.com/repos/Snieezy/store","forks_url":"https://api.github.com/repos/Snieezy/store/forks","keys_url":"https://api.github.com/repos/Snieezy/store/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Snieezy/store/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Snieezy/store/teams","hooks_url":"https://api.github.com/repos/Snieezy/store/hooks","issue_events_url":"https://api.github.com/repos/Snieezy/store/issues/events{/number}","events_url":"https://api.github.com/repos/Snieezy/store/events","assignees_url":"https://api.github.com/repos/Snieezy/store/assignees{/user}","branches_url":"https://api.github.com/repos/Snieezy/store/branches{/branch}","tags_url":"https://api.github.com/repos/Snieezy/store/tags","blobs_url":"https://api.github.com/repos/Snieezy/store/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Snieezy/store/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Snieezy/store/git/refs{/sha}","trees_url":"https://api.github.com/repos/Snieezy/store/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Snieezy/store/statuses/{sha}","languages_url":"https://api.github.com/repos/Snieezy/store/languages","stargazers_url":"https://api.github.com/repos/Snieezy/store/stargazers","contributors_url":"https://api.github.com/repos/Snieezy/store/contributors","subscribers_url":"https://api.github.com/repos/Snieezy/store/subscribers","subscription_url":"https://api.github.com/repos/Snieezy/store/subscription","commits_url":"https://api.github.com/repos/Snieezy/store/commits{/sha}","git_commits_url":"https://api.github.com/repos/Snieezy/store/git/commits{/sha}","comments_url":"https://api.github.com/repos/Snieezy/store/comments{/number}","issue_comment_url":"https://api.github.com/repos/Snieezy/store/issues/comments{/number}","contents_url":"https://api.github.com/repos/Snieezy/store/contents/{+path}","compare_url":"https://api.github.com/repos/Snieezy/store/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Snieezy/store/merges","archive_url":"https://api.github.com/repos/Snieezy/store/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Snieezy/store/downloads","issues_url":"https://api.github.com/repos/Snieezy/store/issues{/number}","pulls_url":"https://api.github.com/repos/Snieezy/store/pulls{/number}","milestones_url":"https://api.github.com/repos/Snieezy/store/milestones{/number}","notifications_url":"https://api.github.com/repos/Snieezy/store/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Snieezy/store/labels{/name}","releases_url":"https://api.github.com/repos/Snieezy/store/releases{/id}","deployments_url":"https://api.github.com/repos/Snieezy/store/deployments","created_at":"2016-07-06T15:07:00Z","updated_at":"2016-07-06T15:11:39Z","pushed_at":"2016-07-12T23:06:03Z","git_url":"git://github.com/Snieezy/store.git","ssh_url":"git@github.com:Snieezy/store.git","clone_url":"https://github.com/Snieezy/store.git","svn_url":"https://github.com/Snieezy/store","homepage":null,"size":54,"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/Snieezy/store/pulls/2"},"html":{"href":"https://github.com/Snieezy/store/pull/2"},"issue":{"href":"https://api.github.com/repos/Snieezy/store/issues/2"},"comments":{"href":"https://api.github.com/repos/Snieezy/store/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Snieezy/store/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Snieezy/store/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Snieezy/store/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Snieezy/store/statuses/1e1146e2a630d2e9072095ae550accca482d15c7"}}}}
{"actor":{"display_login":"gotar"}}