{"action":"created","comment":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/32113207","id":32113207,"diff_hunk":"@@ -0,0 +1,44 @@\n+require_relative 'file_contents'\n+\n+class Finder\n+  def initialize(files)\n+    @contents = []\n+    files.each do |file|\n+      @contents << FileContents.new(file)\n+    end\n+  end\n+\n+  def find(pattern)\n+    result = []\n+    @contents.each do |contents|\n+      result += [contents.filename + ': '] + contents.lines.select do |line|\n+        line.include?(pattern)\n+      end\n+    end\n+    result\n+  end\n+\n+  def find_with_amount(pattern)\n+    result = []\n+    @contents.each do |contents|\n+      result += [contents.filename + ': ']\n+      contents.lines.each.with_index do |line, index|\n+        if line.include?(pattern)\n+          line += \" before: #{index}, after: #{contents.lines.length - index - 1}\" \n+  \t  \t  result << line\n+  \t    end\n+  \t  end\n+    end\n+    result\n+  end\n+\n+  def find_using_regexp(pattern)\n+    result = []\n+    @contents.each do |contents|\n+  \t  result += [contents.filename + ': '] + contents.lines.select do |line|\n+        line =~ Regexp.new(pattern)\n+      end","path":"2015/DemukhIlya/homework_2-2/lib/finder.rb","position":40,"original_position":40,"commit_id":"acba6df56a3e5c19a54f7e327fa1e2a3f7d4bad0","original_commit_id":"acba6df56a3e5c19a54f7e327fa1e2a3f7d4bad0","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"`end` at 40, 6 is not aligned with `result` at 38, 5","created_at":"2015-06-10T12:49:19Z","updated_at":"2015-06-10T12:49:19Z","html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/59#discussion_r32113207","pull_request_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/32113207"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/59#discussion_r32113207"},"pull_request":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/59","id":37354657,"html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/59","diff_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/59.diff","patch_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/59.patch","issue_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/59","number":59,"state":"open","locked":false,"title":"Game of Life","user":{"login":"surrenderboy","id":12209038,"avatar_url":"https://avatars.githubusercontent.com/u/12209038?v=3","gravatar_id":"","url":"https://api.github.com/users/surrenderboy","html_url":"https://github.com/surrenderboy","followers_url":"https://api.github.com/users/surrenderboy/followers","following_url":"https://api.github.com/users/surrenderboy/following{/other_user}","gists_url":"https://api.github.com/users/surrenderboy/gists{/gist_id}","starred_url":"https://api.github.com/users/surrenderboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surrenderboy/subscriptions","organizations_url":"https://api.github.com/users/surrenderboy/orgs","repos_url":"https://api.github.com/users/surrenderboy/repos","events_url":"https://api.github.com/users/surrenderboy/events{/privacy}","received_events_url":"https://api.github.com/users/surrenderboy/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-10T12:49:12Z","updated_at":"2015-06-10T12:49:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f55620a3fcce735192ba4ed9f0b22c9c0feed746","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/59/commits","review_comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/59/comments","review_comment_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/59/comments","statuses_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/acba6df56a3e5c19a54f7e327fa1e2a3f7d4bad0","head":{"label":"surrenderboy:game-of-life","ref":"game-of-life","sha":"acba6df56a3e5c19a54f7e327fa1e2a3f7d4bad0","user":{"login":"surrenderboy","id":12209038,"avatar_url":"https://avatars.githubusercontent.com/u/12209038?v=3","gravatar_id":"","url":"https://api.github.com/users/surrenderboy","html_url":"https://github.com/surrenderboy","followers_url":"https://api.github.com/users/surrenderboy/followers","following_url":"https://api.github.com/users/surrenderboy/following{/other_user}","gists_url":"https://api.github.com/users/surrenderboy/gists{/gist_id}","starred_url":"https://api.github.com/users/surrenderboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surrenderboy/subscriptions","organizations_url":"https://api.github.com/users/surrenderboy/orgs","repos_url":"https://api.github.com/users/surrenderboy/repos","events_url":"https://api.github.com/users/surrenderboy/events{/privacy}","received_events_url":"https://api.github.com/users/surrenderboy/received_events","type":"User","site_admin":false},"repo":{"id":35107001,"name":"bsuir-courses","full_name":"surrenderboy/bsuir-courses","owner":{"login":"surrenderboy","id":12209038,"avatar_url":"https://avatars.githubusercontent.com/u/12209038?v=3","gravatar_id":"","url":"https://api.github.com/users/surrenderboy","html_url":"https://github.com/surrenderboy","followers_url":"https://api.github.com/users/surrenderboy/followers","following_url":"https://api.github.com/users/surrenderboy/following{/other_user}","gists_url":"https://api.github.com/users/surrenderboy/gists{/gist_id}","starred_url":"https://api.github.com/users/surrenderboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surrenderboy/subscriptions","organizations_url":"https://api.github.com/users/surrenderboy/orgs","repos_url":"https://api.github.com/users/surrenderboy/repos","events_url":"https://api.github.com/users/surrenderboy/events{/privacy}","received_events_url":"https://api.github.com/users/surrenderboy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/surrenderboy/bsuir-courses","description":"This is common repository for all student to submit all their homeworks","fork":true,"url":"https://api.github.com/repos/surrenderboy/bsuir-courses","forks_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/forks","keys_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/teams","hooks_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/hooks","issue_events_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/issues/events{/number}","events_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/events","assignees_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/assignees{/user}","branches_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/branches{/branch}","tags_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/tags","blobs_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/languages","stargazers_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/stargazers","contributors_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/contributors","subscribers_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/subscribers","subscription_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/subscription","commits_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/contents/{+path}","compare_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/merges","archive_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/downloads","issues_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/issues{/number}","pulls_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/labels{/name}","releases_url":"https://api.github.com/repos/surrenderboy/bsuir-courses/releases{/id}","created_at":"2015-05-05T15:08:47Z","updated_at":"2015-05-06T05:25:24Z","pushed_at":"2015-06-10T12:48:33Z","git_url":"git://github.com/surrenderboy/bsuir-courses.git","ssh_url":"git@github.com:surrenderboy/bsuir-courses.git","clone_url":"https://github.com/surrenderboy/bsuir-courses.git","svn_url":"https://github.com/surrenderboy/bsuir-courses","homepage":null,"size":305,"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":"rubyroidlabs:master","ref":"master","sha":"4983765ae9028bfa65fed9ceba8e204efff6ccda","user":{"login":"rubyroidlabs","id":5137565,"avatar_url":"https://avatars.githubusercontent.com/u/5137565?v=3","gravatar_id":"","url":"https://api.github.com/users/rubyroidlabs","html_url":"https://github.com/rubyroidlabs","followers_url":"https://api.github.com/users/rubyroidlabs/followers","following_url":"https://api.github.com/users/rubyroidlabs/following{/other_user}","gists_url":"https://api.github.com/users/rubyroidlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rubyroidlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubyroidlabs/subscriptions","organizations_url":"https://api.github.com/users/rubyroidlabs/orgs","repos_url":"https://api.github.com/users/rubyroidlabs/repos","events_url":"https://api.github.com/users/rubyroidlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rubyroidlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":14405320,"name":"bsuir-courses","full_name":"rubyroidlabs/bsuir-courses","owner":{"login":"rubyroidlabs","id":5137565,"avatar_url":"https://avatars.githubusercontent.com/u/5137565?v=3","gravatar_id":"","url":"https://api.github.com/users/rubyroidlabs","html_url":"https://github.com/rubyroidlabs","followers_url":"https://api.github.com/users/rubyroidlabs/followers","following_url":"https://api.github.com/users/rubyroidlabs/following{/other_user}","gists_url":"https://api.github.com/users/rubyroidlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rubyroidlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubyroidlabs/subscriptions","organizations_url":"https://api.github.com/users/rubyroidlabs/orgs","repos_url":"https://api.github.com/users/rubyroidlabs/repos","events_url":"https://api.github.com/users/rubyroidlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rubyroidlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubyroidlabs/bsuir-courses","description":"This is common repository for all student to submit all their homeworks","fork":false,"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses","forks_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/forks","keys_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/teams","hooks_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/hooks","issue_events_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/events{/number}","events_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/events","assignees_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/assignees{/user}","branches_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/branches{/branch}","tags_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/tags","blobs_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/languages","stargazers_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/stargazers","contributors_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/contributors","subscribers_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/subscribers","subscription_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/subscription","commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/contents/{+path}","compare_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/merges","archive_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/downloads","issues_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues{/number}","pulls_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/labels{/name}","releases_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/releases{/id}","created_at":"2013-11-14T19:55:12Z","updated_at":"2015-05-04T11:23:23Z","pushed_at":"2015-06-10T12:49:13Z","git_url":"git://github.com/rubyroidlabs/bsuir-courses.git","ssh_url":"git@github.com:rubyroidlabs/bsuir-courses.git","clone_url":"https://github.com/rubyroidlabs/bsuir-courses.git","svn_url":"https://github.com/rubyroidlabs/bsuir-courses","homepage":null,"size":1398,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":21,"forks":44,"open_issues":21,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/59"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/59"},"issue":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/59"},"comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/acba6df56a3e5c19a54f7e327fa1e2a3f7d4bad0"}}}}