{"action":"created","comment":{"url":"https://api.github.com/repos/how-is/how_is/pulls/comments/116416327","pull_request_review_id":38035049,"id":116416327,"diff_hunk":"@@ -42,74 +39,73 @@ def call(argv)\n         | E.g., if you wanted to check https://github.com/how-is/how_is,\n         | you'd run `how_is how-is/how_is`.\n         |\n-        EOF\n-\n-      opts.separator \"\"\n-      opts.separator \"Options:\"\n-\n-      # Allowed arguments:\n-      opts.bool   \"-h\", \"--help\",    \"Print help text\"\n-      opts.string       \"--config\",  \"YAML config file, used to generate a group of reports\"\n-      opts.string       \"--from\",    \"JSON report file, used instead of fetching the data again\"\n-      opts.string       \"--report\",  \"output file for the report (valid extensions: #{HowIs.supported_formats.join(', ')}; default: #{DEFAULT_REPORT_FILE})\"\n-      opts.bool   \"-v\", \"--version\", \"prints the version\"\n-\n-      # Parse the arguments.\n-      parser    = Slop::Parser.new(opts)\n-      result    = parser.parse(argv)\n-\n-      # +options+ is a Hash of flags/values.\n-      options   = result.to_hash\n-      # +arguments+ is an Array of values that don't correspond to a flag.\n-      arguments = result.arguments\n-\n-      # If --report isn't specified, default to DEFAULT_REPORT_FILE.\n-      options[:report] ||= DEFAULT_REPORT_FILE\n-\n-      # The following are only useful if they're not nil or false.\n-      # Removing them here simplifies contracts and keyword args for\n-      # other APIs.\n-      options.delete(:config)   unless options[:config]\n-      options.delete(:help)     unless options[:help]\n-      options.delete(:version)  unless options[:version]\n-\n-      # If we can't export to the specified file, raise an exception.\n-      unless HowIs.can_export_to?(options[:report])\n-        raise InvalidOutputFileError, \"Invalid file: #{options[:report_file]}. Supported formats: #{HowIs.supported_formats.join(', ')}\"\n-      end\n+      EOF\n+\n+    opts.separator \"\"\n+    opts.separator \"Options:\"\n+\n+    # Allowed arguments:\n+    opts.bool   \"-h\", \"--help\",    \"Print help text\"\n+    opts.string       \"--config\",  \"YAML config file, used to generate a group of reports\"\n+    opts.string       \"--from\",    \"JSON report file, used instead of fetching the data again\"\n+    opts.string       \"--report\",  \"output file for the report (valid extensions: #{HowIs.supported_formats.join(', ')}; default: #{DEFAULT_REPORT_FILE})\"\n+    opts.bool   \"-v\", \"--version\", \"prints the version\"\n+\n+    # Parse the arguments.\n+    parser    = Slop::Parser.new(opts)\n+    result    = parser.parse(argv)\n+\n+    # +options+ is a Hash of flags/values.\n+    options   = result.to_hash\n+    # +arguments+ is an Array of values that don't correspond to a flag.\n+    arguments = result.arguments\n+\n+    # If --report isn't specified, default to DEFAULT_REPORT_FILE.\n+    options[:report] ||= DEFAULT_REPORT_FILE\n+\n+    # The following are only useful if they're not nil or false.\n+    # Removing them here simplifies contracts and keyword args for\n+    # other APIs.\n+    options.delete(:config)   unless options[:config]\n+    options.delete(:help)     unless options[:help]\n+    options.delete(:version)  unless options[:version]\n+\n+    # If we can't export to the specified file, raise an exception.\n+    unless HowIs.can_export_to?(options[:report])\n+      raise InvalidOutputFileError, \"Invalid file: #{options[:report]}. Supported formats: #{HowIs.supported_formats.join(', ')}\"\n+    end\n \n-      # If we pass --config, other options (excluding --help and\n-      # --version) are ignored. As such, when --config is passed,\n-      # everything in this `unless` block is irrelevant.\n-      unless options[:config]\n-        if options[:from]\n-          raise InvalidInputFileError, \"No such file: #{options[:from]}\" unless File.file?(options[:from])\n+    # If we pass --config, other options (excluding --help and\n+    # --version) are ignored. As such, when --config is passed,\n+    # everything in this `unless` block is irrelevant.\n+    unless options[:config]\n+      if options[:from]\n+        raise InvalidInputFileError, \"No such file: #{options[:from]}\" unless File.file?(options[:from])\n \n-          # Opening the file here is a bit gross, but I couldn't find a\n-          # better way to do it. -@duckinator\n-          options[:repository] = JSON.parse(open(options[:from]).read)['repository']\n+        # Opening the file here is a bit gross, but I couldn't find a\n+        # better way to do it. -@duckinator\n+        options[:repository] = JSON.parse(open(options[:from]).read)['repository']\n \n-          raise InvalidInputFileError, \"Invalid JSON report file.\" unless options[:repository]\n+        raise InvalidInputFileError, \"Invalid JSON report file.\" unless options[:repository]\n \n-        elsif argv.length >= 1\n-          options[:repository] = argv.delete_at(0)\n+      elsif argv.length >= 1\n+        options[:repository] = argv.delete_at(0)\n \n-        else\n-          raise NoRepositoryError, \"No repository specified.\"\n-        end\n+      else\n+        raise NoRepositoryError, \"No repository specified.\"","path":"lib/how_is/cli.rb","position":133,"original_position":133,"commit_id":"522ebebc37aba43caae00597bc332187d2ef64b3","original_commit_id":"522ebebc37aba43caae00597bc332187d2ef64b3","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars3.githubusercontent.com/u/6697940?v=3","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":"Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2017-05-15T06:14:14Z","updated_at":"2017-05-15T06:14:15Z","html_url":"https://github.com/how-is/how_is/pull/157#discussion_r116416327","pull_request_url":"https://api.github.com/repos/how-is/how_is/pulls/157","_links":{"self":{"href":"https://api.github.com/repos/how-is/how_is/pulls/comments/116416327"},"html":{"href":"https://github.com/how-is/how_is/pull/157#discussion_r116416327"},"pull_request":{"href":"https://api.github.com/repos/how-is/how_is/pulls/157"}}},"pull_request":{"url":"https://api.github.com/repos/how-is/how_is/pulls/157","id":118305097,"html_url":"https://github.com/how-is/how_is/pull/157","diff_url":"https://github.com/how-is/how_is/pull/157.diff","patch_url":"https://github.com/how-is/how_is/pull/157.patch","issue_url":"https://api.github.com/repos/how-is/how_is/issues/157","number":157,"state":"open","locked":false,"title":"[WIP] CLI parser refactor","user":{"login":"duckinator","id":39698,"avatar_url":"https://avatars0.githubusercontent.com/u/39698?v=3","gravatar_id":"","url":"https://api.github.com/users/duckinator","html_url":"https://github.com/duckinator","followers_url":"https://api.github.com/users/duckinator/followers","following_url":"https://api.github.com/users/duckinator/following{/other_user}","gists_url":"https://api.github.com/users/duckinator/gists{/gist_id}","starred_url":"https://api.github.com/users/duckinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckinator/subscriptions","organizations_url":"https://api.github.com/users/duckinator/orgs","repos_url":"https://api.github.com/users/duckinator/repos","events_url":"https://api.github.com/users/duckinator/events{/privacy}","received_events_url":"https://api.github.com/users/duckinator/received_events","type":"User","site_admin":false},"body":"TODO:\r\n\r\n* [ ] Add failing test indicating `exe/how_is` is broken.\r\n* [ ] Fix things so said test passes.","created_at":"2017-04-30T08:35:16Z","updated_at":"2017-05-15T06:14:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7004900ee62b6bbdb679f40601925d540611342a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/how-is/how_is/pulls/157/commits","review_comments_url":"https://api.github.com/repos/how-is/how_is/pulls/157/comments","review_comment_url":"https://api.github.com/repos/how-is/how_is/pulls/comments{/number}","comments_url":"https://api.github.com/repos/how-is/how_is/issues/157/comments","statuses_url":"https://api.github.com/repos/how-is/how_is/statuses/522ebebc37aba43caae00597bc332187d2ef64b3","head":{"label":"how-is:cli-parser-refactor","ref":"cli-parser-refactor","sha":"522ebebc37aba43caae00597bc332187d2ef64b3","user":{"login":"how-is","id":20577802,"avatar_url":"https://avatars3.githubusercontent.com/u/20577802?v=3","gravatar_id":"","url":"https://api.github.com/users/how-is","html_url":"https://github.com/how-is","followers_url":"https://api.github.com/users/how-is/followers","following_url":"https://api.github.com/users/how-is/following{/other_user}","gists_url":"https://api.github.com/users/how-is/gists{/gist_id}","starred_url":"https://api.github.com/users/how-is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/how-is/subscriptions","organizations_url":"https://api.github.com/users/how-is/orgs","repos_url":"https://api.github.com/users/how-is/repos","events_url":"https://api.github.com/users/how-is/events{/privacy}","received_events_url":"https://api.github.com/users/how-is/received_events","type":"Organization","site_admin":false},"repo":{"id":54295243,"name":"how_is","full_name":"how-is/how_is","owner":{"login":"how-is","id":20577802,"avatar_url":"https://avatars3.githubusercontent.com/u/20577802?v=3","gravatar_id":"","url":"https://api.github.com/users/how-is","html_url":"https://github.com/how-is","followers_url":"https://api.github.com/users/how-is/followers","following_url":"https://api.github.com/users/how-is/following{/other_user}","gists_url":"https://api.github.com/users/how-is/gists{/gist_id}","starred_url":"https://api.github.com/users/how-is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/how-is/subscriptions","organizations_url":"https://api.github.com/users/how-is/orgs","repos_url":"https://api.github.com/users/how-is/repos","events_url":"https://api.github.com/users/how-is/events{/privacy}","received_events_url":"https://api.github.com/users/how-is/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/how-is/how_is","description":"A gem that explains the state of a GitHub repository.","fork":false,"url":"https://api.github.com/repos/how-is/how_is","forks_url":"https://api.github.com/repos/how-is/how_is/forks","keys_url":"https://api.github.com/repos/how-is/how_is/keys{/key_id}","collaborators_url":"https://api.github.com/repos/how-is/how_is/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/how-is/how_is/teams","hooks_url":"https://api.github.com/repos/how-is/how_is/hooks","issue_events_url":"https://api.github.com/repos/how-is/how_is/issues/events{/number}","events_url":"https://api.github.com/repos/how-is/how_is/events","assignees_url":"https://api.github.com/repos/how-is/how_is/assignees{/user}","branches_url":"https://api.github.com/repos/how-is/how_is/branches{/branch}","tags_url":"https://api.github.com/repos/how-is/how_is/tags","blobs_url":"https://api.github.com/repos/how-is/how_is/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/how-is/how_is/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/how-is/how_is/git/refs{/sha}","trees_url":"https://api.github.com/repos/how-is/how_is/git/trees{/sha}","statuses_url":"https://api.github.com/repos/how-is/how_is/statuses/{sha}","languages_url":"https://api.github.com/repos/how-is/how_is/languages","stargazers_url":"https://api.github.com/repos/how-is/how_is/stargazers","contributors_url":"https://api.github.com/repos/how-is/how_is/contributors","subscribers_url":"https://api.github.com/repos/how-is/how_is/subscribers","subscription_url":"https://api.github.com/repos/how-is/how_is/subscription","commits_url":"https://api.github.com/repos/how-is/how_is/commits{/sha}","git_commits_url":"https://api.github.com/repos/how-is/how_is/git/commits{/sha}","comments_url":"https://api.github.com/repos/how-is/how_is/comments{/number}","issue_comment_url":"https://api.github.com/repos/how-is/how_is/issues/comments{/number}","contents_url":"https://api.github.com/repos/how-is/how_is/contents/{+path}","compare_url":"https://api.github.com/repos/how-is/how_is/compare/{base}...{head}","merges_url":"https://api.github.com/repos/how-is/how_is/merges","archive_url":"https://api.github.com/repos/how-is/how_is/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/how-is/how_is/downloads","issues_url":"https://api.github.com/repos/how-is/how_is/issues{/number}","pulls_url":"https://api.github.com/repos/how-is/how_is/pulls{/number}","milestones_url":"https://api.github.com/repos/how-is/how_is/milestones{/number}","notifications_url":"https://api.github.com/repos/how-is/how_is/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/how-is/how_is/labels{/name}","releases_url":"https://api.github.com/repos/how-is/how_is/releases{/id}","deployments_url":"https://api.github.com/repos/how-is/how_is/deployments","created_at":"2016-03-20T01:37:02Z","updated_at":"2017-05-02T07:03:53Z","pushed_at":"2017-05-15T06:14:07Z","git_url":"git://github.com/how-is/how_is.git","ssh_url":"git@github.com:how-is/how_is.git","clone_url":"https://github.com/how-is/how_is.git","svn_url":"https://github.com/how-is/how_is","homepage":"","size":1223,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":25,"forks":5,"open_issues":25,"watchers":25,"default_branch":"master"}},"base":{"label":"how-is:master","ref":"master","sha":"4b3ad7a6da0b916e18f8dcdb827f902ee7e2c2a0","user":{"login":"how-is","id":20577802,"avatar_url":"https://avatars3.githubusercontent.com/u/20577802?v=3","gravatar_id":"","url":"https://api.github.com/users/how-is","html_url":"https://github.com/how-is","followers_url":"https://api.github.com/users/how-is/followers","following_url":"https://api.github.com/users/how-is/following{/other_user}","gists_url":"https://api.github.com/users/how-is/gists{/gist_id}","starred_url":"https://api.github.com/users/how-is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/how-is/subscriptions","organizations_url":"https://api.github.com/users/how-is/orgs","repos_url":"https://api.github.com/users/how-is/repos","events_url":"https://api.github.com/users/how-is/events{/privacy}","received_events_url":"https://api.github.com/users/how-is/received_events","type":"Organization","site_admin":false},"repo":{"id":54295243,"name":"how_is","full_name":"how-is/how_is","owner":{"login":"how-is","id":20577802,"avatar_url":"https://avatars3.githubusercontent.com/u/20577802?v=3","gravatar_id":"","url":"https://api.github.com/users/how-is","html_url":"https://github.com/how-is","followers_url":"https://api.github.com/users/how-is/followers","following_url":"https://api.github.com/users/how-is/following{/other_user}","gists_url":"https://api.github.com/users/how-is/gists{/gist_id}","starred_url":"https://api.github.com/users/how-is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/how-is/subscriptions","organizations_url":"https://api.github.com/users/how-is/orgs","repos_url":"https://api.github.com/users/how-is/repos","events_url":"https://api.github.com/users/how-is/events{/privacy}","received_events_url":"https://api.github.com/users/how-is/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/how-is/how_is","description":"A gem that explains the state of a GitHub repository.","fork":false,"url":"https://api.github.com/repos/how-is/how_is","forks_url":"https://api.github.com/repos/how-is/how_is/forks","keys_url":"https://api.github.com/repos/how-is/how_is/keys{/key_id}","collaborators_url":"https://api.github.com/repos/how-is/how_is/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/how-is/how_is/teams","hooks_url":"https://api.github.com/repos/how-is/how_is/hooks","issue_events_url":"https://api.github.com/repos/how-is/how_is/issues/events{/number}","events_url":"https://api.github.com/repos/how-is/how_is/events","assignees_url":"https://api.github.com/repos/how-is/how_is/assignees{/user}","branches_url":"https://api.github.com/repos/how-is/how_is/branches{/branch}","tags_url":"https://api.github.com/repos/how-is/how_is/tags","blobs_url":"https://api.github.com/repos/how-is/how_is/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/how-is/how_is/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/how-is/how_is/git/refs{/sha}","trees_url":"https://api.github.com/repos/how-is/how_is/git/trees{/sha}","statuses_url":"https://api.github.com/repos/how-is/how_is/statuses/{sha}","languages_url":"https://api.github.com/repos/how-is/how_is/languages","stargazers_url":"https://api.github.com/repos/how-is/how_is/stargazers","contributors_url":"https://api.github.com/repos/how-is/how_is/contributors","subscribers_url":"https://api.github.com/repos/how-is/how_is/subscribers","subscription_url":"https://api.github.com/repos/how-is/how_is/subscription","commits_url":"https://api.github.com/repos/how-is/how_is/commits{/sha}","git_commits_url":"https://api.github.com/repos/how-is/how_is/git/commits{/sha}","comments_url":"https://api.github.com/repos/how-is/how_is/comments{/number}","issue_comment_url":"https://api.github.com/repos/how-is/how_is/issues/comments{/number}","contents_url":"https://api.github.com/repos/how-is/how_is/contents/{+path}","compare_url":"https://api.github.com/repos/how-is/how_is/compare/{base}...{head}","merges_url":"https://api.github.com/repos/how-is/how_is/merges","archive_url":"https://api.github.com/repos/how-is/how_is/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/how-is/how_is/downloads","issues_url":"https://api.github.com/repos/how-is/how_is/issues{/number}","pulls_url":"https://api.github.com/repos/how-is/how_is/pulls{/number}","milestones_url":"https://api.github.com/repos/how-is/how_is/milestones{/number}","notifications_url":"https://api.github.com/repos/how-is/how_is/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/how-is/how_is/labels{/name}","releases_url":"https://api.github.com/repos/how-is/how_is/releases{/id}","deployments_url":"https://api.github.com/repos/how-is/how_is/deployments","created_at":"2016-03-20T01:37:02Z","updated_at":"2017-05-02T07:03:53Z","pushed_at":"2017-05-15T06:14:07Z","git_url":"git://github.com/how-is/how_is.git","ssh_url":"git@github.com:how-is/how_is.git","clone_url":"https://github.com/how-is/how_is.git","svn_url":"https://github.com/how-is/how_is","homepage":"","size":1223,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":25,"forks":5,"open_issues":25,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/how-is/how_is/pulls/157"},"html":{"href":"https://github.com/how-is/how_is/pull/157"},"issue":{"href":"https://api.github.com/repos/how-is/how_is/issues/157"},"comments":{"href":"https://api.github.com/repos/how-is/how_is/issues/157/comments"},"review_comments":{"href":"https://api.github.com/repos/how-is/how_is/pulls/157/comments"},"review_comment":{"href":"https://api.github.com/repos/how-is/how_is/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/how-is/how_is/pulls/157/commits"},"statuses":{"href":"https://api.github.com/repos/how-is/how_is/statuses/522ebebc37aba43caae00597bc332187d2ef64b3"}}}}
{"actor":{"display_login":"houndci-bot"}}