{"action":"created","comment":{"url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/comments/241947149","pull_request_review_id":185352333,"id":241947149,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTk0NzE0OQ==","diff_hunk":"@@ -0,0 +1,60 @@\n+require 'find'\n+require 'rubyXL'\n+#require 'pry'\n+\n+count = 0\n+prices = []\n+dates = []\n+workbooks = []\n+\n+puts \"What price are you looking for?\"\n+ans = gets.chomp\n+ans.upcase!\n+\n+Find.find('./data/') do |file|\n+  if file =~ /\\b.xlsx$\\b/\n+    workbook = RubyXL::Parser.parse(file).worksheets\n+    workbooks << workbook\n+    workbook.each do |worksheet_rows|\n+      if worksheet_rows[2][0].value.include?(\"2018\")\n+        current_year_prices = worksheet_rows\n+      end\n+      num_rows = 0\n+      date = worksheet_rows[2][0].value\n+      worksheet_rows.select { |row| row&.cells&.at(0)&.value }.each_with_index do |row, index|\n+        item_name = row.cells[0].value\n+        price = row.cells[14]&.value || 0\n+        if row.cells[0].value.include?(ans)\n+          dates << date\n+          prices << price\n+          if price != 0 && !price.to_s.include?(\".\")\n+            new_price = (price.to_f/10000).round(2)\n+            puts \"#{item_name} is #{new_price} BYN #{date}\"\n+            prices << new_price\n+          else\n+            puts \"#{item_name} is #{price} BYN in Minsk these days\"\n+          end\n+        end\n+      end\n+      index_min = prices.each_with_index.min[1]\n+      index_max = prices.select{|f| Float === f}.each_with_index.max[1]\n+      similar_items = []\n+      if worksheet_rows[2][0].value.include?(\"2018\")\n+        worksheet_rows.select { |row| row&.cells&.at(0)&.value }.each_with_index do |row, index|\n+          item_price = row.cells[14]&.value || 0\n+          if item_price > prices[index_min]  && item_price < prices[index_max]\n+            similar_items << row.cells[0].value\n+          end\n+        end\n+      end\n+      puts \"For similar price you also can afford:\"\n+      similar_items.each do |item|\n+        puts \"#{item}\"","path":"Alena Zubritskaya/0/level3.rb","position":52,"original_position":52,"commit_id":"14b5bfc9a44f2d4f5df186d34d572de1af830ac5","original_commit_id":"14b5bfc9a44f2d4f5df186d34d572de1af830ac5","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","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/UnneededInterpolation: Prefer to_s over string interpolation.","created_at":"2018-12-15T11:51:53Z","updated_at":"2018-12-15T11:51:56Z","html_url":"https://github.com/rubizza-survival-camp/winter-2018/pull/36#discussion_r241947149","pull_request_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/36","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/comments/241947149"},"html":{"href":"https://github.com/rubizza-survival-camp/winter-2018/pull/36#discussion_r241947149"},"pull_request":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/36","id":237156857,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTU2ODU3","html_url":"https://github.com/rubizza-survival-camp/winter-2018/pull/36","diff_url":"https://github.com/rubizza-survival-camp/winter-2018/pull/36.diff","patch_url":"https://github.com/rubizza-survival-camp/winter-2018/pull/36.patch","issue_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/36","number":36,"state":"open","locked":false,"title":"Alena Zubritskaya - 0","user":{"login":"superpuper777","id":31541313,"node_id":"MDQ6VXNlcjMxNTQxMzEz","avatar_url":"https://avatars2.githubusercontent.com/u/31541313?v=4","gravatar_id":"","url":"https://api.github.com/users/superpuper777","html_url":"https://github.com/superpuper777","followers_url":"https://api.github.com/users/superpuper777/followers","following_url":"https://api.github.com/users/superpuper777/following{/other_user}","gists_url":"https://api.github.com/users/superpuper777/gists{/gist_id}","starred_url":"https://api.github.com/users/superpuper777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superpuper777/subscriptions","organizations_url":"https://api.github.com/users/superpuper777/orgs","repos_url":"https://api.github.com/users/superpuper777/repos","events_url":"https://api.github.com/users/superpuper777/events{/privacy}","received_events_url":"https://api.github.com/users/superpuper777/received_events","type":"User","site_admin":false},"body":"## Name\r\nAlena Zubritskaya\r\n\r\n## Homework#\r\n0\r\n\r\n## Comment\r\nLevel 1","created_at":"2018-12-09T21:01:19Z","updated_at":"2018-12-15T11:51:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e344caa266531f43ae86d34fac8ccd62bb67610e","assignee":{"login":"RGBD","id":8408991,"node_id":"MDQ6VXNlcjg0MDg5OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/8408991?v=4","gravatar_id":"","url":"https://api.github.com/users/RGBD","html_url":"https://github.com/RGBD","followers_url":"https://api.github.com/users/RGBD/followers","following_url":"https://api.github.com/users/RGBD/following{/other_user}","gists_url":"https://api.github.com/users/RGBD/gists{/gist_id}","starred_url":"https://api.github.com/users/RGBD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RGBD/subscriptions","organizations_url":"https://api.github.com/users/RGBD/orgs","repos_url":"https://api.github.com/users/RGBD/repos","events_url":"https://api.github.com/users/RGBD/events{/privacy}","received_events_url":"https://api.github.com/users/RGBD/received_events","type":"User","site_admin":false},"assignees":[{"login":"RGBD","id":8408991,"node_id":"MDQ6VXNlcjg0MDg5OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/8408991?v=4","gravatar_id":"","url":"https://api.github.com/users/RGBD","html_url":"https://github.com/RGBD","followers_url":"https://api.github.com/users/RGBD/followers","following_url":"https://api.github.com/users/RGBD/following{/other_user}","gists_url":"https://api.github.com/users/RGBD/gists{/gist_id}","starred_url":"https://api.github.com/users/RGBD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RGBD/subscriptions","organizations_url":"https://api.github.com/users/RGBD/orgs","repos_url":"https://api.github.com/users/RGBD/repos","events_url":"https://api.github.com/users/RGBD/events{/privacy}","received_events_url":"https://api.github.com/users/RGBD/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/36/commits","review_comments_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/36/comments","review_comment_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/36/comments","statuses_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/statuses/14b5bfc9a44f2d4f5df186d34d572de1af830ac5","head":{"label":"superpuper777:homework_0","ref":"homework_0","sha":"14b5bfc9a44f2d4f5df186d34d572de1af830ac5","user":{"login":"superpuper777","id":31541313,"node_id":"MDQ6VXNlcjMxNTQxMzEz","avatar_url":"https://avatars2.githubusercontent.com/u/31541313?v=4","gravatar_id":"","url":"https://api.github.com/users/superpuper777","html_url":"https://github.com/superpuper777","followers_url":"https://api.github.com/users/superpuper777/followers","following_url":"https://api.github.com/users/superpuper777/following{/other_user}","gists_url":"https://api.github.com/users/superpuper777/gists{/gist_id}","starred_url":"https://api.github.com/users/superpuper777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superpuper777/subscriptions","organizations_url":"https://api.github.com/users/superpuper777/orgs","repos_url":"https://api.github.com/users/superpuper777/repos","events_url":"https://api.github.com/users/superpuper777/events{/privacy}","received_events_url":"https://api.github.com/users/superpuper777/received_events","type":"User","site_admin":false},"repo":{"id":161078804,"node_id":"MDEwOlJlcG9zaXRvcnkxNjEwNzg4MDQ=","name":"winter-2018","full_name":"superpuper777/winter-2018","private":false,"owner":{"login":"superpuper777","id":31541313,"node_id":"MDQ6VXNlcjMxNTQxMzEz","avatar_url":"https://avatars2.githubusercontent.com/u/31541313?v=4","gravatar_id":"","url":"https://api.github.com/users/superpuper777","html_url":"https://github.com/superpuper777","followers_url":"https://api.github.com/users/superpuper777/followers","following_url":"https://api.github.com/users/superpuper777/following{/other_user}","gists_url":"https://api.github.com/users/superpuper777/gists{/gist_id}","starred_url":"https://api.github.com/users/superpuper777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superpuper777/subscriptions","organizations_url":"https://api.github.com/users/superpuper777/orgs","repos_url":"https://api.github.com/users/superpuper777/repos","events_url":"https://api.github.com/users/superpuper777/events{/privacy}","received_events_url":"https://api.github.com/users/superpuper777/received_events","type":"User","site_admin":false},"html_url":"https://github.com/superpuper777/winter-2018","description":null,"fork":true,"url":"https://api.github.com/repos/superpuper777/winter-2018","forks_url":"https://api.github.com/repos/superpuper777/winter-2018/forks","keys_url":"https://api.github.com/repos/superpuper777/winter-2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/superpuper777/winter-2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/superpuper777/winter-2018/teams","hooks_url":"https://api.github.com/repos/superpuper777/winter-2018/hooks","issue_events_url":"https://api.github.com/repos/superpuper777/winter-2018/issues/events{/number}","events_url":"https://api.github.com/repos/superpuper777/winter-2018/events","assignees_url":"https://api.github.com/repos/superpuper777/winter-2018/assignees{/user}","branches_url":"https://api.github.com/repos/superpuper777/winter-2018/branches{/branch}","tags_url":"https://api.github.com/repos/superpuper777/winter-2018/tags","blobs_url":"https://api.github.com/repos/superpuper777/winter-2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/superpuper777/winter-2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/superpuper777/winter-2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/superpuper777/winter-2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/superpuper777/winter-2018/statuses/{sha}","languages_url":"https://api.github.com/repos/superpuper777/winter-2018/languages","stargazers_url":"https://api.github.com/repos/superpuper777/winter-2018/stargazers","contributors_url":"https://api.github.com/repos/superpuper777/winter-2018/contributors","subscribers_url":"https://api.github.com/repos/superpuper777/winter-2018/subscribers","subscription_url":"https://api.github.com/repos/superpuper777/winter-2018/subscription","commits_url":"https://api.github.com/repos/superpuper777/winter-2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/superpuper777/winter-2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/superpuper777/winter-2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/superpuper777/winter-2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/superpuper777/winter-2018/contents/{+path}","compare_url":"https://api.github.com/repos/superpuper777/winter-2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/superpuper777/winter-2018/merges","archive_url":"https://api.github.com/repos/superpuper777/winter-2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/superpuper777/winter-2018/downloads","issues_url":"https://api.github.com/repos/superpuper777/winter-2018/issues{/number}","pulls_url":"https://api.github.com/repos/superpuper777/winter-2018/pulls{/number}","milestones_url":"https://api.github.com/repos/superpuper777/winter-2018/milestones{/number}","notifications_url":"https://api.github.com/repos/superpuper777/winter-2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/superpuper777/winter-2018/labels{/name}","releases_url":"https://api.github.com/repos/superpuper777/winter-2018/releases{/id}","deployments_url":"https://api.github.com/repos/superpuper777/winter-2018/deployments","created_at":"2018-12-09T20:32:28Z","updated_at":"2018-12-09T20:32:30Z","pushed_at":"2018-12-15T11:51:28Z","git_url":"git://github.com/superpuper777/winter-2018.git","ssh_url":"git@github.com:superpuper777/winter-2018.git","clone_url":"https://github.com/superpuper777/winter-2018.git","svn_url":"https://github.com/superpuper777/winter-2018","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rubizza-survival-camp:master","ref":"master","sha":"239176854cd958c2c990eaf651bbb394d0fc6345","user":{"login":"rubizza-survival-camp","id":40864986,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwODY0OTg2","avatar_url":"https://avatars1.githubusercontent.com/u/40864986?v=4","gravatar_id":"","url":"https://api.github.com/users/rubizza-survival-camp","html_url":"https://github.com/rubizza-survival-camp","followers_url":"https://api.github.com/users/rubizza-survival-camp/followers","following_url":"https://api.github.com/users/rubizza-survival-camp/following{/other_user}","gists_url":"https://api.github.com/users/rubizza-survival-camp/gists{/gist_id}","starred_url":"https://api.github.com/users/rubizza-survival-camp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubizza-survival-camp/subscriptions","organizations_url":"https://api.github.com/users/rubizza-survival-camp/orgs","repos_url":"https://api.github.com/users/rubizza-survival-camp/repos","events_url":"https://api.github.com/users/rubizza-survival-camp/events{/privacy}","received_events_url":"https://api.github.com/users/rubizza-survival-camp/received_events","type":"Organization","site_admin":false},"repo":{"id":159675553,"node_id":"MDEwOlJlcG9zaXRvcnkxNTk2NzU1NTM=","name":"winter-2018","full_name":"rubizza-survival-camp/winter-2018","private":false,"owner":{"login":"rubizza-survival-camp","id":40864986,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwODY0OTg2","avatar_url":"https://avatars1.githubusercontent.com/u/40864986?v=4","gravatar_id":"","url":"https://api.github.com/users/rubizza-survival-camp","html_url":"https://github.com/rubizza-survival-camp","followers_url":"https://api.github.com/users/rubizza-survival-camp/followers","following_url":"https://api.github.com/users/rubizza-survival-camp/following{/other_user}","gists_url":"https://api.github.com/users/rubizza-survival-camp/gists{/gist_id}","starred_url":"https://api.github.com/users/rubizza-survival-camp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubizza-survival-camp/subscriptions","organizations_url":"https://api.github.com/users/rubizza-survival-camp/orgs","repos_url":"https://api.github.com/users/rubizza-survival-camp/repos","events_url":"https://api.github.com/users/rubizza-survival-camp/events{/privacy}","received_events_url":"https://api.github.com/users/rubizza-survival-camp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/rubizza-survival-camp/winter-2018","description":null,"fork":false,"url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018","forks_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/forks","keys_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/teams","hooks_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/hooks","issue_events_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/events{/number}","events_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/events","assignees_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/assignees{/user}","branches_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/branches{/branch}","tags_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/tags","blobs_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/statuses/{sha}","languages_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/languages","stargazers_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/stargazers","contributors_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/contributors","subscribers_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/subscribers","subscription_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/subscription","commits_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/contents/{+path}","compare_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/merges","archive_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/downloads","issues_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues{/number}","pulls_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls{/number}","milestones_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/milestones{/number}","notifications_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/labels{/name}","releases_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/releases{/id}","deployments_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/deployments","created_at":"2018-11-29T14:06:05Z","updated_at":"2018-12-13T09:09:28Z","pushed_at":"2018-12-15T11:51:30Z","git_url":"git://github.com/rubizza-survival-camp/winter-2018.git","ssh_url":"git@github.com:rubizza-survival-camp/winter-2018.git","clone_url":"https://github.com/rubizza-survival-camp/winter-2018.git","svn_url":"https://github.com/rubizza-survival-camp/winter-2018","homepage":null,"size":82,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":18,"license":null,"forks":30,"open_issues":18,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/36"},"html":{"href":"https://github.com/rubizza-survival-camp/winter-2018/pull/36"},"issue":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/36"},"comments":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/statuses/14b5bfc9a44f2d4f5df186d34d572de1af830ac5"}},"author_association":"NONE"}}
{"actor":{"display_login":"houndci-bot"}}