{"action":"created","comment":{"url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/comments/202901678","pull_request_review_id":137684522,"id":202901678,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjkwMTY3OA==","diff_hunk":"@@ -0,0 +1,208 @@\n+require 'russian_obscenity'\n+require 'active_support/all'\n+\n+# sdfsdf\n+class BattlesAnalyzer\n+  def initialize(path = __dir__ + '/texts')\n+    @paths = Dir[path + '/*'] # Path to directory with texts convertes to array of paths to each file\n+    @list = {}\n+  end\n+\n+  def path=(new_path)\n+    raise AnalyzerArgumentError, new_path unless new_path.respond_to?(:to_s)\n+    @paths = Dir[new_path.to_s + '/*']\n+  end\n+\n+  def rounds(name = nil)\n+    @list = {}\n+    @paths.each do |path|\n+      name_in_file = get_name_in_file(path)\n+      explore_file(name_in_file) { count_rounds(path) } if !name || name_in_file == name\n+    end\n+    @list\n+  end\n+\n+  def battles(name = nil)\n+    @list = {}\n+    @paths.each do |path|\n+      name_in_file = get_name_in_file(path)\n+      add_entry_to_list(name_in_file, 1) if !name || name_in_file == name\n+    end\n+    @list\n+  end\n+\n+private\n+\n+  def get_name_in_file(path)\n+    name_in_file = path.match(%r{(?<=/texts/\\s).*?((?=\\s+против\\s+)|(?=\\s+VS\\s+)|(?=\\s+vs\\s+))}).to_s\n+    raise AnalyzerTextNameError, path if name_in_file == ''\n+    name_in_file\n+  end\n+\n+  def explore_file(name_in_file)\n+    words_number = yield\n+    add_entry_to_list(name_in_file, words_number)\n+  end\n+\n+  def add_entry_to_list(name, number)\n+    name = name.to_sym\n+    @list[name] = @list.key?(name) ? @list[name] + number : number\n+  end\n+\n+  def count_rounds(path)\n+    rounds_counter = 0\n+    file = File.open(path)\n+    file.each do |line|\n+      words = to_word_array(line)\n+      rounds_counter += 1 if round_description?(words)\n+    end\n+    rounds_counter.zero? ? 1 : rounds_counter\n+  end\n+\n+  def to_word_array(line)\n+    words = line.split(/[^[[:word:]]\\*]+/)\n+    words\n+  end\n+\n+  def round_description?(words)\n+    return true if !words[1].to_i.zero? && words[0] =~ /(Р|р)аунд/\n+    return true if !words[0].to_i.zero? && words[1] =~ /(Р|р)аунд/\n+    false\n+  end\n+end\n+\n+# Class f123123\n+class WordsAnalyzer < BattlesAnalyzer\n+  attr_reader :paths\n+\n+  def words(name = nil)","path":"2263/2/analizer.rb","position":78,"original_position":78,"commit_id":"0c8f95378f54b745b492c11836768305404499e2","original_commit_id":"0c8f95378f54b745b492c11836768305404499e2","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":"TooManyStatements: WordsAnalyzer#words has approx 6 statements. [More info](https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md).","created_at":"2018-07-17T05:58:39Z","updated_at":"2018-07-17T05:58:41Z","html_url":"https://github.com/rubizza-survival-camp/summer-2018/pull/238#discussion_r202901678","pull_request_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/238","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/comments/202901678"},"html":{"href":"https://github.com/rubizza-survival-camp/summer-2018/pull/238#discussion_r202901678"},"pull_request":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/238"}}},"pull_request":{"url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/238","id":201515606,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNTE1NjA2","html_url":"https://github.com/rubizza-survival-camp/summer-2018/pull/238","diff_url":"https://github.com/rubizza-survival-camp/summer-2018/pull/238.diff","patch_url":"https://github.com/rubizza-survival-camp/summer-2018/pull/238.patch","issue_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/issues/238","number":238,"state":"open","locked":false,"title":"2263 - 2 [WIP]","user":{"login":"ARtoriouSs","id":33663194,"node_id":"MDQ6VXNlcjMzNjYzMTk0","avatar_url":"https://avatars3.githubusercontent.com/u/33663194?v=4","gravatar_id":"","url":"https://api.github.com/users/ARtoriouSs","html_url":"https://github.com/ARtoriouSs","followers_url":"https://api.github.com/users/ARtoriouSs/followers","following_url":"https://api.github.com/users/ARtoriouSs/following{/other_user}","gists_url":"https://api.github.com/users/ARtoriouSs/gists{/gist_id}","starred_url":"https://api.github.com/users/ARtoriouSs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARtoriouSs/subscriptions","organizations_url":"https://api.github.com/users/ARtoriouSs/orgs","repos_url":"https://api.github.com/users/ARtoriouSs/repos","events_url":"https://api.github.com/users/ARtoriouSs/events{/privacy}","received_events_url":"https://api.github.com/users/ARtoriouSs/received_events","type":"User","site_admin":false},"body":"## Номер\r\n2263\r\n\r\n## Номер задания\r\n2\r\n\r\n## Ссылка на видео с демо\r\nhttps://youtu.be/1hxyibIvLM8\r\n\r\n## Комментарии\r\nДва уровня\r\n","created_at":"2018-07-15T21:03:34Z","updated_at":"2018-07-17T05:58:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6100fbae034c5022d8d7af0c0dcbcdbca166688c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/238/commits","review_comments_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/238/comments","review_comment_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/issues/238/comments","statuses_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/statuses/0c8f95378f54b745b492c11836768305404499e2","head":{"label":"ARtoriouSs:b2","ref":"b2","sha":"0c8f95378f54b745b492c11836768305404499e2","user":{"login":"ARtoriouSs","id":33663194,"node_id":"MDQ6VXNlcjMzNjYzMTk0","avatar_url":"https://avatars3.githubusercontent.com/u/33663194?v=4","gravatar_id":"","url":"https://api.github.com/users/ARtoriouSs","html_url":"https://github.com/ARtoriouSs","followers_url":"https://api.github.com/users/ARtoriouSs/followers","following_url":"https://api.github.com/users/ARtoriouSs/following{/other_user}","gists_url":"https://api.github.com/users/ARtoriouSs/gists{/gist_id}","starred_url":"https://api.github.com/users/ARtoriouSs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARtoriouSs/subscriptions","organizations_url":"https://api.github.com/users/ARtoriouSs/orgs","repos_url":"https://api.github.com/users/ARtoriouSs/repos","events_url":"https://api.github.com/users/ARtoriouSs/events{/privacy}","received_events_url":"https://api.github.com/users/ARtoriouSs/received_events","type":"User","site_admin":false},"repo":{"id":140265111,"node_id":"MDEwOlJlcG9zaXRvcnkxNDAyNjUxMTE=","name":"summer-2018","full_name":"ARtoriouSs/summer-2018","owner":{"login":"ARtoriouSs","id":33663194,"node_id":"MDQ6VXNlcjMzNjYzMTk0","avatar_url":"https://avatars3.githubusercontent.com/u/33663194?v=4","gravatar_id":"","url":"https://api.github.com/users/ARtoriouSs","html_url":"https://github.com/ARtoriouSs","followers_url":"https://api.github.com/users/ARtoriouSs/followers","following_url":"https://api.github.com/users/ARtoriouSs/following{/other_user}","gists_url":"https://api.github.com/users/ARtoriouSs/gists{/gist_id}","starred_url":"https://api.github.com/users/ARtoriouSs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARtoriouSs/subscriptions","organizations_url":"https://api.github.com/users/ARtoriouSs/orgs","repos_url":"https://api.github.com/users/ARtoriouSs/repos","events_url":"https://api.github.com/users/ARtoriouSs/events{/privacy}","received_events_url":"https://api.github.com/users/ARtoriouSs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ARtoriouSs/summer-2018","description":null,"fork":true,"url":"https://api.github.com/repos/ARtoriouSs/summer-2018","forks_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/forks","keys_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/teams","hooks_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/hooks","issue_events_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/issues/events{/number}","events_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/events","assignees_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/assignees{/user}","branches_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/branches{/branch}","tags_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/tags","blobs_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/statuses/{sha}","languages_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/languages","stargazers_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/stargazers","contributors_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/contributors","subscribers_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/subscribers","subscription_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/subscription","commits_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/contents/{+path}","compare_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/merges","archive_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/downloads","issues_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/issues{/number}","pulls_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/pulls{/number}","milestones_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/milestones{/number}","notifications_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/labels{/name}","releases_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/releases{/id}","deployments_url":"https://api.github.com/repos/ARtoriouSs/summer-2018/deployments","created_at":"2018-07-09T09:47:01Z","updated_at":"2018-07-09T09:47:03Z","pushed_at":"2018-07-17T05:58:22Z","git_url":"git://github.com/ARtoriouSs/summer-2018.git","ssh_url":"git@github.com:ARtoriouSs/summer-2018.git","clone_url":"https://github.com/ARtoriouSs/summer-2018.git","svn_url":"https://github.com/ARtoriouSs/summer-2018","homepage":null,"size":87464,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"5b27b0cb11a122c46d22061b1ea067d6a84fbf52","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":139868408,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk4Njg0MDg=","name":"summer-2018","full_name":"rubizza-survival-camp/summer-2018","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},"private":false,"html_url":"https://github.com/rubizza-survival-camp/summer-2018","description":null,"fork":false,"url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018","forks_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/forks","keys_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/teams","hooks_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/hooks","issue_events_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/issues/events{/number}","events_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/events","assignees_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/assignees{/user}","branches_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/branches{/branch}","tags_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/tags","blobs_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/statuses/{sha}","languages_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/languages","stargazers_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/stargazers","contributors_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/contributors","subscribers_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/subscribers","subscription_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/subscription","commits_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/contents/{+path}","compare_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/merges","archive_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/downloads","issues_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/issues{/number}","pulls_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls{/number}","milestones_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/milestones{/number}","notifications_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/labels{/name}","releases_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/releases{/id}","deployments_url":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/deployments","created_at":"2018-07-05T15:28:12Z","updated_at":"2018-07-16T09:21:18Z","pushed_at":"2018-07-17T05:58:25Z","git_url":"git://github.com/rubizza-survival-camp/summer-2018.git","ssh_url":"git@github.com:rubizza-survival-camp/summer-2018.git","clone_url":"https://github.com/rubizza-survival-camp/summer-2018.git","svn_url":"https://github.com/rubizza-survival-camp/summer-2018","homepage":null,"size":86821,"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":58,"mirror_url":null,"archived":false,"open_issues_count":39,"license":null,"forks":58,"open_issues":39,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/238"},"html":{"href":"https://github.com/rubizza-survival-camp/summer-2018/pull/238"},"issue":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/issues/238"},"comments":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/issues/238/comments"},"review_comments":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/238/comments"},"review_comment":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/pulls/238/commits"},"statuses":{"href":"https://api.github.com/repos/rubizza-survival-camp/summer-2018/statuses/0c8f95378f54b745b492c11836768305404499e2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}