{"action":"created","comment":{"url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/comments/240398870","pull_request_review_id":183421848,"id":240398870,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDM5ODg3MA==","diff_hunk":"@@ -0,0 +1,100 @@\n+require 'rubygems'\n+require 'roo'\n+require 'roo-xls'\n+require 'sqlite3'\n+require 'logger'\n+\n+COST_INDEX = 3\n+REGION_INDEX = 2\n+DATE_FOR_DENOMIZATION = 1482181200\n+AMOUNT_FOR_DENOMOZATION = 10000.0\n+\n+class DataParser\n+  def perform_files\n+    xls_files = Dir['./data/*.xls']\n+    xlsx_files = Dir['./data/*.xlsx']\n+    puts 'Perform data:'\n+    xlsx_files.each do |path|\n+      print '.'\n+      date = convert_to_unix_date(path)\n+      table = Roo::Spreadsheet.open(path)\n+      perform_rows(table, date)\n+    rescue Zip::Error => e\n+      logger.warn \"Problem with parser, error: #{e}, file - #{path} \"\n+    end\n+\n+    xls_files.each do |path|\n+      print '.'\n+      date = convert_to_unix_date(path)\n+      table = Roo::Excel.new(path)\n+      perform_rows(table, date)\n+    rescue Zip::Error => e\n+      logger.warn \"Problem with parser, error: #{e}, file - #{path} \"\n+    rescue SQLite3::SQLException => e\n+      logger.warn \"Problem with parser, error: #{e}, file - #{path} \"\n+    rescue Ole::Storage::FormatError => e\n+      logger.warn \"Problem with parser, error: #{e}, file - #{path} \"\n+    end\n+  end\n+\n+  def perform_rows(table, date)\n+    (9..table.last_row).each do |number|\n+      row = table.row(number)\n+      check_data = (row[0].is_a?(String) && row[6].is_a?(Numeric) && row[8].is_a?(Numeric)) &&\n+       (row[12].is_a?(Numeric) && row[14].is_a?(Numeric) && row[16].is_a?(Numeric) && row[18].is_a?(Numeric))\n+    next unless check_data\n+      product_name = row[0].downcase\n+      brest_region = row[6]\n+      vitebsk_region = row[8]\n+      homel_region = row[10]\n+      grodno_region = row[12]\n+      minsk = row[14]\n+      minsk_region = row[16]\n+      mogilev_region = row[18]\n+\n+      if date < DATE_FOR_DENOMIZATION\n+        brest_region = brest_region / AMOUNT_FOR_DENOMOZATION if !brest_region.nil?\n+        vitebsk_region = vitebsk_region / AMOUNT_FOR_DENOMOZATION if !vitebsk_region.nil?\n+        homel_region = homel_region / AMOUNT_FOR_DENOMOZATION if !homel_region.nil?\n+        grodno_region = grodno_region / AMOUNT_FOR_DENOMOZATION if !grodno_region.nil?\n+        minsk = minsk / AMOUNT_FOR_DENOMOZATION if !minsk.nil?\n+        minsk_region = minsk_region / AMOUNT_FOR_DENOMOZATION if !minsk_region.nil?\n+        mogilev_region = mogilev_region / AMOUNT_FOR_DENOMOZATION if !mogilev_region.nil?\n+      end\n+\n+      @db.execute \"INSERT INTO Items (name, region, price, date) VALUES('#{product_name}','Брестская область',#{brest_region}, #{date})\"\n+      @db.execute \"INSERT INTO Items (name, region, price, date) VALUES('#{product_name}','Витебская область',#{vitebsk_region}, #{date})\"","path":"Elizaveta_Shved/Elizaveta Shved : 0 :/data_parser.rb","position":66,"original_position":66,"commit_id":"3dfc96c0e2f49c44e2602379f45bc8fbc1d79f66","original_commit_id":"3dfc96c0e2f49c44e2602379f45bc8fbc1d79f66","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":"Metrics/LineLength: Line is too long. [138/120]","created_at":"2018-12-10T22:04:50Z","updated_at":"2018-12-10T22:04:51Z","html_url":"https://github.com/rubizza-survival-camp/winter-2018/pull/38#discussion_r240398870","pull_request_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/38","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/comments/240398870"},"html":{"href":"https://github.com/rubizza-survival-camp/winter-2018/pull/38#discussion_r240398870"},"pull_request":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/38","id":237160155,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTYwMTU1","html_url":"https://github.com/rubizza-survival-camp/winter-2018/pull/38","diff_url":"https://github.com/rubizza-survival-camp/winter-2018/pull/38.diff","patch_url":"https://github.com/rubizza-survival-camp/winter-2018/pull/38.patch","issue_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/38","number":38,"state":"open","locked":false,"title":"Elizaveta Shved - 0","user":{"login":"elishved","id":33182370,"node_id":"MDQ6VXNlcjMzMTgyMzcw","avatar_url":"https://avatars3.githubusercontent.com/u/33182370?v=4","gravatar_id":"","url":"https://api.github.com/users/elishved","html_url":"https://github.com/elishved","followers_url":"https://api.github.com/users/elishved/followers","following_url":"https://api.github.com/users/elishved/following{/other_user}","gists_url":"https://api.github.com/users/elishved/gists{/gist_id}","starred_url":"https://api.github.com/users/elishved/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elishved/subscriptions","organizations_url":"https://api.github.com/users/elishved/orgs","repos_url":"https://api.github.com/users/elishved/repos","events_url":"https://api.github.com/users/elishved/events{/privacy}","received_events_url":"https://api.github.com/users/elishved/received_events","type":"User","site_admin":false},"body":"## Name\r\nElizaveta Shved\r\n\r\n## Homework#\r\n0\r\n\r\n## Comment\r\nLevel 1, 2 and 3.\r\n","created_at":"2018-12-09T21:58:12Z","updated_at":"2018-12-10T22:04:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4b856568352a31981d26f05e8098e06e12b4095","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/38/commits","review_comments_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/38/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/38/comments","statuses_url":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/statuses/3dfc96c0e2f49c44e2602379f45bc8fbc1d79f66","head":{"label":"elishved:task_0_rubizza","ref":"task_0_rubizza","sha":"3dfc96c0e2f49c44e2602379f45bc8fbc1d79f66","user":{"login":"elishved","id":33182370,"node_id":"MDQ6VXNlcjMzMTgyMzcw","avatar_url":"https://avatars3.githubusercontent.com/u/33182370?v=4","gravatar_id":"","url":"https://api.github.com/users/elishved","html_url":"https://github.com/elishved","followers_url":"https://api.github.com/users/elishved/followers","following_url":"https://api.github.com/users/elishved/following{/other_user}","gists_url":"https://api.github.com/users/elishved/gists{/gist_id}","starred_url":"https://api.github.com/users/elishved/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elishved/subscriptions","organizations_url":"https://api.github.com/users/elishved/orgs","repos_url":"https://api.github.com/users/elishved/repos","events_url":"https://api.github.com/users/elishved/events{/privacy}","received_events_url":"https://api.github.com/users/elishved/received_events","type":"User","site_admin":false},"repo":{"id":161078797,"node_id":"MDEwOlJlcG9zaXRvcnkxNjEwNzg3OTc=","name":"winter-2018","full_name":"elishved/winter-2018","private":false,"owner":{"login":"elishved","id":33182370,"node_id":"MDQ6VXNlcjMzMTgyMzcw","avatar_url":"https://avatars3.githubusercontent.com/u/33182370?v=4","gravatar_id":"","url":"https://api.github.com/users/elishved","html_url":"https://github.com/elishved","followers_url":"https://api.github.com/users/elishved/followers","following_url":"https://api.github.com/users/elishved/following{/other_user}","gists_url":"https://api.github.com/users/elishved/gists{/gist_id}","starred_url":"https://api.github.com/users/elishved/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elishved/subscriptions","organizations_url":"https://api.github.com/users/elishved/orgs","repos_url":"https://api.github.com/users/elishved/repos","events_url":"https://api.github.com/users/elishved/events{/privacy}","received_events_url":"https://api.github.com/users/elishved/received_events","type":"User","site_admin":false},"html_url":"https://github.com/elishved/winter-2018","description":null,"fork":true,"url":"https://api.github.com/repos/elishved/winter-2018","forks_url":"https://api.github.com/repos/elishved/winter-2018/forks","keys_url":"https://api.github.com/repos/elishved/winter-2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elishved/winter-2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elishved/winter-2018/teams","hooks_url":"https://api.github.com/repos/elishved/winter-2018/hooks","issue_events_url":"https://api.github.com/repos/elishved/winter-2018/issues/events{/number}","events_url":"https://api.github.com/repos/elishved/winter-2018/events","assignees_url":"https://api.github.com/repos/elishved/winter-2018/assignees{/user}","branches_url":"https://api.github.com/repos/elishved/winter-2018/branches{/branch}","tags_url":"https://api.github.com/repos/elishved/winter-2018/tags","blobs_url":"https://api.github.com/repos/elishved/winter-2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elishved/winter-2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elishved/winter-2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/elishved/winter-2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elishved/winter-2018/statuses/{sha}","languages_url":"https://api.github.com/repos/elishved/winter-2018/languages","stargazers_url":"https://api.github.com/repos/elishved/winter-2018/stargazers","contributors_url":"https://api.github.com/repos/elishved/winter-2018/contributors","subscribers_url":"https://api.github.com/repos/elishved/winter-2018/subscribers","subscription_url":"https://api.github.com/repos/elishved/winter-2018/subscription","commits_url":"https://api.github.com/repos/elishved/winter-2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/elishved/winter-2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/elishved/winter-2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/elishved/winter-2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/elishved/winter-2018/contents/{+path}","compare_url":"https://api.github.com/repos/elishved/winter-2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elishved/winter-2018/merges","archive_url":"https://api.github.com/repos/elishved/winter-2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elishved/winter-2018/downloads","issues_url":"https://api.github.com/repos/elishved/winter-2018/issues{/number}","pulls_url":"https://api.github.com/repos/elishved/winter-2018/pulls{/number}","milestones_url":"https://api.github.com/repos/elishved/winter-2018/milestones{/number}","notifications_url":"https://api.github.com/repos/elishved/winter-2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elishved/winter-2018/labels{/name}","releases_url":"https://api.github.com/repos/elishved/winter-2018/releases{/id}","deployments_url":"https://api.github.com/repos/elishved/winter-2018/deployments","created_at":"2018-12-09T20:32:23Z","updated_at":"2018-12-09T20:32:25Z","pushed_at":"2018-12-10T22:04:23Z","git_url":"git://github.com/elishved/winter-2018.git","ssh_url":"git@github.com:elishved/winter-2018.git","clone_url":"https://github.com/elishved/winter-2018.git","svn_url":"https://github.com/elishved/winter-2018","homepage":null,"size":44,"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-10T09:45:25Z","pushed_at":"2018-12-10T22:04:25Z","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":39,"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":31,"mirror_url":null,"archived":false,"open_issues_count":23,"license":null,"forks":31,"open_issues":23,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/38"},"html":{"href":"https://github.com/rubizza-survival-camp/winter-2018/pull/38"},"issue":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/38"},"comments":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/pulls/38/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/38/commits"},"statuses":{"href":"https://api.github.com/repos/rubizza-survival-camp/winter-2018/statuses/3dfc96c0e2f49c44e2602379f45bc8fbc1d79f66"}},"author_association":"NONE"}}
{"actor":{"display_login":"houndci-bot"}}