{"action":"created","comment":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/144435562","pull_request_review_id":69093376,"id":144435562,"diff_hunk":"@@ -0,0 +1,72 @@\n+require 'json'\n+class Menu\n+  def menu(file_stream, tree, file_name)\n+    Dir.chdir('trees')\n+    if !file_name\n+      menu_forest(file_stream, tree)\n+    elsif File.exist?(file_name)\n+      menu_single_tree(file_stream, file_name, tree)\n+    else\n+      p 'There are no such trees in our forest.'\n+    end\n+    p 'Thank you for visiting in our forest.'\n+  end\n+\n+  def menu_forest(file_stream, tree)\n+    array_trees = load_forest.sort\n+    array_trees.each do |index|\n+      if array_trees.to_s[index].include?('.tree')\n+        menu_single_tree(file_stream, array_trees.to_s[index], tree)\n+        unless extension_check\n+          break\n+        end\n+      end\n+    end\n+  end\n+\n+  def menu_single_tree(file_stream, file_name, tree)\n+    array = file_stream.get_parsed_file(file_name)\n+    tree.initialization(array, 0, tree.create_root, 1)\n+    p \"==={#{file_name}}===\"\n+    tree.get_tree(tree.tree_root)\n+\n+    if tree.count_sum_nodes(tree.tree_root) > 5000\n+      p 'To cut down.'\n+      File.delete(file_name)\n+    elsif !tree.check_depth(tree.tree_root)\n+      p 'Crop.'\n+      tree.crop(tree.tree_root)\n+      tree.get_tree(tree.tree_root)\n+      p 'Cropped tree.'\n+    else\n+      p 'Leave.'\n+    end\n+  end\n+\n+  def get_directory\n+    Dir.new(Dir.pwd)\n+  end\n+\n+  def load_forest\n+    Dir.entries(get_directory)\n+  end\n+\n+  def extension_check\n+    loop do\n+      p 'Would you like to continue browsing the trees?(y/n)'\n+      answer = gets.chomp\n+      flg = case answer.to_s\n+              when 'yes', 'Yes', 'y', 'YES'","path":"2017/VladislauMakarevich/1/menu.rb","position":59,"original_position":59,"commit_id":"330a425729491b5131b06b01e5c492d99f192cc2","original_commit_id":"330a425729491b5131b06b01e5c492d99f192cc2","user":{"login":"houndci-bot","id":6697940,"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":"Indent when as deep as case.","created_at":"2017-10-12T23:31:49Z","updated_at":"2017-10-12T23:31:49Z","html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/553#discussion_r144435562","pull_request_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/553","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/144435562"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/553#discussion_r144435562"},"pull_request":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/553"}}},"pull_request":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/553","id":146294903,"html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/553","diff_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/553.diff","patch_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/553.patch","issue_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/553","number":553,"state":"open","locked":false,"title":"implement homework-1","user":{"login":"VladMakarevich2017","id":32576419,"avatar_url":"https://avatars0.githubusercontent.com/u/32576419?v=4","gravatar_id":"","url":"https://api.github.com/users/VladMakarevich2017","html_url":"https://github.com/VladMakarevich2017","followers_url":"https://api.github.com/users/VladMakarevich2017/followers","following_url":"https://api.github.com/users/VladMakarevich2017/following{/other_user}","gists_url":"https://api.github.com/users/VladMakarevich2017/gists{/gist_id}","starred_url":"https://api.github.com/users/VladMakarevich2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladMakarevich2017/subscriptions","organizations_url":"https://api.github.com/users/VladMakarevich2017/orgs","repos_url":"https://api.github.com/users/VladMakarevich2017/repos","events_url":"https://api.github.com/users/VladMakarevich2017/events{/privacy}","received_events_url":"https://api.github.com/users/VladMakarevich2017/received_events","type":"User","site_admin":false},"body":"## Фамилия Имя\r\nМакаревич Владислав\r\n\r\n## Email\r\nvlad_makarevich@mail.ru\r\n\r\n## Номер домашнего задания\r\n1\r\n\r\n## Ссылка на видео с демо работы\r\nhttps://www.youtube.com/watch?v=HzuEWP9AJi0&list=PL3OZUZ3XclrNBdogsPctpSynk26inIVPQ\r\n\r\n## Комментарии\r\nСделал 3 уровня\r\n","created_at":"2017-10-12T19:32:31Z","updated_at":"2017-10-12T23:31:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0bdbaeb5bfca2ca448ed16b70a043492c459b329","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/553/commits","review_comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/553/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/553/comments","statuses_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/330a425729491b5131b06b01e5c492d99f192cc2","head":{"label":"VladMakarevich2017:homework-1","ref":"homework-1","sha":"330a425729491b5131b06b01e5c492d99f192cc2","user":{"login":"VladMakarevich2017","id":32576419,"avatar_url":"https://avatars0.githubusercontent.com/u/32576419?v=4","gravatar_id":"","url":"https://api.github.com/users/VladMakarevich2017","html_url":"https://github.com/VladMakarevich2017","followers_url":"https://api.github.com/users/VladMakarevich2017/followers","following_url":"https://api.github.com/users/VladMakarevich2017/following{/other_user}","gists_url":"https://api.github.com/users/VladMakarevich2017/gists{/gist_id}","starred_url":"https://api.github.com/users/VladMakarevich2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladMakarevich2017/subscriptions","organizations_url":"https://api.github.com/users/VladMakarevich2017/orgs","repos_url":"https://api.github.com/users/VladMakarevich2017/repos","events_url":"https://api.github.com/users/VladMakarevich2017/events{/privacy}","received_events_url":"https://api.github.com/users/VladMakarevich2017/received_events","type":"User","site_admin":false},"repo":{"id":106731208,"name":"bsuir-courses","full_name":"VladMakarevich2017/bsuir-courses","owner":{"login":"VladMakarevich2017","id":32576419,"avatar_url":"https://avatars0.githubusercontent.com/u/32576419?v=4","gravatar_id":"","url":"https://api.github.com/users/VladMakarevich2017","html_url":"https://github.com/VladMakarevich2017","followers_url":"https://api.github.com/users/VladMakarevich2017/followers","following_url":"https://api.github.com/users/VladMakarevich2017/following{/other_user}","gists_url":"https://api.github.com/users/VladMakarevich2017/gists{/gist_id}","starred_url":"https://api.github.com/users/VladMakarevich2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladMakarevich2017/subscriptions","organizations_url":"https://api.github.com/users/VladMakarevich2017/orgs","repos_url":"https://api.github.com/users/VladMakarevich2017/repos","events_url":"https://api.github.com/users/VladMakarevich2017/events{/privacy}","received_events_url":"https://api.github.com/users/VladMakarevich2017/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VladMakarevich2017/bsuir-courses","description":"This is common repository for all student to submit all their homeworks","fork":true,"url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses","forks_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/forks","keys_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/teams","hooks_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/hooks","issue_events_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/issues/events{/number}","events_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/events","assignees_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/assignees{/user}","branches_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/branches{/branch}","tags_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/tags","blobs_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/languages","stargazers_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/stargazers","contributors_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/contributors","subscribers_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/subscribers","subscription_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/subscription","commits_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/contents/{+path}","compare_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/merges","archive_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/downloads","issues_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/issues{/number}","pulls_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/labels{/name}","releases_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/releases{/id}","deployments_url":"https://api.github.com/repos/VladMakarevich2017/bsuir-courses/deployments","created_at":"2017-10-12T18:35:07Z","updated_at":"2017-10-12T18:35:10Z","pushed_at":"2017-10-12T23:31:31Z","git_url":"git://github.com/VladMakarevich2017/bsuir-courses.git","ssh_url":"git@github.com:VladMakarevich2017/bsuir-courses.git","clone_url":"https://github.com/VladMakarevich2017/bsuir-courses.git","svn_url":"https://github.com/VladMakarevich2017/bsuir-courses","homepage":null,"size":14483,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rubyroidlabs:master","ref":"master","sha":"4aee13f8b97435b8d3ca59d30aea93e3af4712b2","user":{"login":"rubyroidlabs","id":5137565,"avatar_url":"https://avatars1.githubusercontent.com/u/5137565?v=4","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://avatars1.githubusercontent.com/u/5137565?v=4","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}","deployments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/deployments","created_at":"2013-11-14T19:55:12Z","updated_at":"2017-10-09T03:35:39Z","pushed_at":"2017-10-12T23:31:33Z","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":14433,"stargazers_count":35,"watchers_count":35,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":189,"mirror_url":null,"open_issues_count":17,"forks":189,"open_issues":17,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/553"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/553"},"issue":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/553"},"comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/553/comments"},"review_comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/553/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/553/commits"},"statuses":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/330a425729491b5131b06b01e5c492d99f192cc2"}},"author_association":"NONE"}}
{"actor":{"display_login":"houndci-bot"}}