{"action":"created","comment":{"url":"https://api.github.com/repos/rspec/rspec-core/pulls/comments/77930297","id":77930297,"diff_hunk":"@@ -787,17 +789,49 @@ def color\n         value_for(:color) { @color }\n       end\n \n+      # Returns the configuration option for forcing color, but should not\n+      # be used to check if color is supported.\n+      #\n+      # @see color_enabled?\n+      # @return [Boolean]\n+      def force_color\n+        value_for(:force_color) { @force_color }\n+      end\n+\n+      # Returns the configuration option for forcing no color, but should not\n+      # be used to check if color is supported.\n+      #\n+      # @see color_enabled?\n+      # @return [Boolean]\n+      def no_color\n+        value_for(:no_color) { @no_color }\n+      end\n+\n       # Check if color is enabled for a particular output.\n       # @param output [IO] an output stream to use, defaults to the current\n       #        `output_stream`\n       # @return [Boolean]\n       def color_enabled?(output=output_stream)\n-        output_to_tty?(output) && color\n+        if force_color\n+          true\n+        elsif no_color\n+          false\n+        elsif color\n+          tty? || output_to_tty?(output)\n+        else\n+          output_to_tty?(output)\n+        end\n       end\n \n-      # Toggle output color.\n+      # Deprecated: toggle output color.","path":"lib/rspec/core/configuration.rb","position":58,"original_position":58,"commit_id":"12de2abbbaa16d99d3aaec7cd604cec1e5589e9e","original_commit_id":"12de2abbbaa16d99d3aaec7cd604cec1e5589e9e","user":{"login":"myronmarston","id":49391,"avatar_url":"https://avatars.githubusercontent.com/u/49391?v=3","gravatar_id":"","url":"https://api.github.com/users/myronmarston","html_url":"https://github.com/myronmarston","followers_url":"https://api.github.com/users/myronmarston/followers","following_url":"https://api.github.com/users/myronmarston/following{/other_user}","gists_url":"https://api.github.com/users/myronmarston/gists{/gist_id}","starred_url":"https://api.github.com/users/myronmarston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myronmarston/subscriptions","organizations_url":"https://api.github.com/users/myronmarston/orgs","repos_url":"https://api.github.com/users/myronmarston/repos","events_url":"https://api.github.com/users/myronmarston/events{/privacy}","received_events_url":"https://api.github.com/users/myronmarston/received_events","type":"User","site_admin":false},"body":"Same here -- please use the YARD `@deprecated` tag.","created_at":"2016-09-08T00:43:44Z","updated_at":"2016-09-08T00:43:44Z","html_url":"https://github.com/rspec/rspec-core/pull/2321#discussion_r77930297","pull_request_url":"https://api.github.com/repos/rspec/rspec-core/pulls/2321","_links":{"self":{"href":"https://api.github.com/repos/rspec/rspec-core/pulls/comments/77930297"},"html":{"href":"https://github.com/rspec/rspec-core/pull/2321#discussion_r77930297"},"pull_request":{"href":"https://api.github.com/repos/rspec/rspec-core/pulls/2321"}}},"pull_request":{"url":"https://api.github.com/repos/rspec/rspec-core/pulls/2321","id":83836280,"html_url":"https://github.com/rspec/rspec-core/pull/2321","diff_url":"https://github.com/rspec/rspec-core/pull/2321.diff","patch_url":"https://github.com/rspec/rspec-core/pull/2321.patch","issue_url":"https://api.github.com/repos/rspec/rspec-core/issues/2321","number":2321,"state":"open","locked":false,"title":"Add --force-color flag","user":{"login":"CodingItWrong","id":15832198,"avatar_url":"https://avatars.githubusercontent.com/u/15832198?v=3","gravatar_id":"","url":"https://api.github.com/users/CodingItWrong","html_url":"https://github.com/CodingItWrong","followers_url":"https://api.github.com/users/CodingItWrong/followers","following_url":"https://api.github.com/users/CodingItWrong/following{/other_user}","gists_url":"https://api.github.com/users/CodingItWrong/gists{/gist_id}","starred_url":"https://api.github.com/users/CodingItWrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodingItWrong/subscriptions","organizations_url":"https://api.github.com/users/CodingItWrong/orgs","repos_url":"https://api.github.com/users/CodingItWrong/repos","events_url":"https://api.github.com/users/CodingItWrong/events{/privacy}","received_events_url":"https://api.github.com/users/CodingItWrong/received_events","type":"User","site_admin":false},"body":"Fixes #2230 by adding a --force-color flag to use alongside --no-color, while preserving backward-compatibility with the --color flag.\r\n\r\nPlease let me know anything I can do to improve this PR! A few thoughts:\r\n\r\n- configuration.rb is a bit more complex than it otherwise might need to be because of --color backward compatibility, but I think it's worth it\r\n- Setting config.no_color = true in spec_helper.rb felt a bit dirty, but I do think the best default behavior in the specs is to _not_ have color in the output, and that was the most reliable way I could find to accomplish that.\r\n- The specs that distinguish the behavior of force_color and no_color when --tty is passed can probably be removed, now that they've demonstrated that that flag doesn't affect their behavior.\r\n- The name of the --force-color flag gets a bit confusing with the ConfigurationOptions method `force` (e.g. it \"forces force_color\"), but I think --force-color is the best external name, and it probably doesn't make sense to consider any renaming of the internal `force` method just for this.\r\n- Reading `no_color = true` and `no_color = false` gets a bit confusing, but this wouldn't extend to end users: they just use --force-color or --no-color and get the expected result. The two different properties are needed, as I describe in the commit message for 9af8f0c, because the default behavior is different from both the force_color and no_color behavior, so there are several different states.","created_at":"2016-09-02T17:20:46Z","updated_at":"2016-09-08T00:43:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3de470e2cc43b289bf04ba3052a567fc5ee765d4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rspec/rspec-core/pulls/2321/commits","review_comments_url":"https://api.github.com/repos/rspec/rspec-core/pulls/2321/comments","review_comment_url":"https://api.github.com/repos/rspec/rspec-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rspec/rspec-core/issues/2321/comments","statuses_url":"https://api.github.com/repos/rspec/rspec-core/statuses/12de2abbbaa16d99d3aaec7cd604cec1e5589e9e","head":{"label":"CodingItWrong:CodingItWrong/2230-color-flags","ref":"CodingItWrong/2230-color-flags","sha":"12de2abbbaa16d99d3aaec7cd604cec1e5589e9e","user":{"login":"CodingItWrong","id":15832198,"avatar_url":"https://avatars.githubusercontent.com/u/15832198?v=3","gravatar_id":"","url":"https://api.github.com/users/CodingItWrong","html_url":"https://github.com/CodingItWrong","followers_url":"https://api.github.com/users/CodingItWrong/followers","following_url":"https://api.github.com/users/CodingItWrong/following{/other_user}","gists_url":"https://api.github.com/users/CodingItWrong/gists{/gist_id}","starred_url":"https://api.github.com/users/CodingItWrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodingItWrong/subscriptions","organizations_url":"https://api.github.com/users/CodingItWrong/orgs","repos_url":"https://api.github.com/users/CodingItWrong/repos","events_url":"https://api.github.com/users/CodingItWrong/events{/privacy}","received_events_url":"https://api.github.com/users/CodingItWrong/received_events","type":"User","site_admin":false},"repo":{"id":67241422,"name":"rspec-core","full_name":"CodingItWrong/rspec-core","owner":{"login":"CodingItWrong","id":15832198,"avatar_url":"https://avatars.githubusercontent.com/u/15832198?v=3","gravatar_id":"","url":"https://api.github.com/users/CodingItWrong","html_url":"https://github.com/CodingItWrong","followers_url":"https://api.github.com/users/CodingItWrong/followers","following_url":"https://api.github.com/users/CodingItWrong/following{/other_user}","gists_url":"https://api.github.com/users/CodingItWrong/gists{/gist_id}","starred_url":"https://api.github.com/users/CodingItWrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodingItWrong/subscriptions","organizations_url":"https://api.github.com/users/CodingItWrong/orgs","repos_url":"https://api.github.com/users/CodingItWrong/repos","events_url":"https://api.github.com/users/CodingItWrong/events{/privacy}","received_events_url":"https://api.github.com/users/CodingItWrong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CodingItWrong/rspec-core","description":"RSpec runner and formatters","fork":true,"url":"https://api.github.com/repos/CodingItWrong/rspec-core","forks_url":"https://api.github.com/repos/CodingItWrong/rspec-core/forks","keys_url":"https://api.github.com/repos/CodingItWrong/rspec-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodingItWrong/rspec-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodingItWrong/rspec-core/teams","hooks_url":"https://api.github.com/repos/CodingItWrong/rspec-core/hooks","issue_events_url":"https://api.github.com/repos/CodingItWrong/rspec-core/issues/events{/number}","events_url":"https://api.github.com/repos/CodingItWrong/rspec-core/events","assignees_url":"https://api.github.com/repos/CodingItWrong/rspec-core/assignees{/user}","branches_url":"https://api.github.com/repos/CodingItWrong/rspec-core/branches{/branch}","tags_url":"https://api.github.com/repos/CodingItWrong/rspec-core/tags","blobs_url":"https://api.github.com/repos/CodingItWrong/rspec-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodingItWrong/rspec-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodingItWrong/rspec-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodingItWrong/rspec-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodingItWrong/rspec-core/statuses/{sha}","languages_url":"https://api.github.com/repos/CodingItWrong/rspec-core/languages","stargazers_url":"https://api.github.com/repos/CodingItWrong/rspec-core/stargazers","contributors_url":"https://api.github.com/repos/CodingItWrong/rspec-core/contributors","subscribers_url":"https://api.github.com/repos/CodingItWrong/rspec-core/subscribers","subscription_url":"https://api.github.com/repos/CodingItWrong/rspec-core/subscription","commits_url":"https://api.github.com/repos/CodingItWrong/rspec-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodingItWrong/rspec-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodingItWrong/rspec-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodingItWrong/rspec-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodingItWrong/rspec-core/contents/{+path}","compare_url":"https://api.github.com/repos/CodingItWrong/rspec-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodingItWrong/rspec-core/merges","archive_url":"https://api.github.com/repos/CodingItWrong/rspec-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodingItWrong/rspec-core/downloads","issues_url":"https://api.github.com/repos/CodingItWrong/rspec-core/issues{/number}","pulls_url":"https://api.github.com/repos/CodingItWrong/rspec-core/pulls{/number}","milestones_url":"https://api.github.com/repos/CodingItWrong/rspec-core/milestones{/number}","notifications_url":"https://api.github.com/repos/CodingItWrong/rspec-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodingItWrong/rspec-core/labels{/name}","releases_url":"https://api.github.com/repos/CodingItWrong/rspec-core/releases{/id}","deployments_url":"https://api.github.com/repos/CodingItWrong/rspec-core/deployments","created_at":"2016-09-02T17:18:09Z","updated_at":"2016-09-02T17:18:12Z","pushed_at":"2016-09-02T17:18:46Z","git_url":"git://github.com/CodingItWrong/rspec-core.git","ssh_url":"git@github.com:CodingItWrong/rspec-core.git","clone_url":"https://github.com/CodingItWrong/rspec-core.git","svn_url":"https://github.com/CodingItWrong/rspec-core","homepage":"http://relishapp.com/rspec/rspec-core","size":10174,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"rspec:master","ref":"master","sha":"6a4376e276e52b89d35aa5e16b74758e9f64b991","user":{"login":"rspec","id":22388,"avatar_url":"https://avatars.githubusercontent.com/u/22388?v=3","gravatar_id":"","url":"https://api.github.com/users/rspec","html_url":"https://github.com/rspec","followers_url":"https://api.github.com/users/rspec/followers","following_url":"https://api.github.com/users/rspec/following{/other_user}","gists_url":"https://api.github.com/users/rspec/gists{/gist_id}","starred_url":"https://api.github.com/users/rspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rspec/subscriptions","organizations_url":"https://api.github.com/users/rspec/orgs","repos_url":"https://api.github.com/users/rspec/repos","events_url":"https://api.github.com/users/rspec/events{/privacy}","received_events_url":"https://api.github.com/users/rspec/received_events","type":"Organization","site_admin":false},"repo":{"id":238972,"name":"rspec-core","full_name":"rspec/rspec-core","owner":{"login":"rspec","id":22388,"avatar_url":"https://avatars.githubusercontent.com/u/22388?v=3","gravatar_id":"","url":"https://api.github.com/users/rspec","html_url":"https://github.com/rspec","followers_url":"https://api.github.com/users/rspec/followers","following_url":"https://api.github.com/users/rspec/following{/other_user}","gists_url":"https://api.github.com/users/rspec/gists{/gist_id}","starred_url":"https://api.github.com/users/rspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rspec/subscriptions","organizations_url":"https://api.github.com/users/rspec/orgs","repos_url":"https://api.github.com/users/rspec/repos","events_url":"https://api.github.com/users/rspec/events{/privacy}","received_events_url":"https://api.github.com/users/rspec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rspec/rspec-core","description":"RSpec runner and formatters","fork":false,"url":"https://api.github.com/repos/rspec/rspec-core","forks_url":"https://api.github.com/repos/rspec/rspec-core/forks","keys_url":"https://api.github.com/repos/rspec/rspec-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rspec/rspec-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rspec/rspec-core/teams","hooks_url":"https://api.github.com/repos/rspec/rspec-core/hooks","issue_events_url":"https://api.github.com/repos/rspec/rspec-core/issues/events{/number}","events_url":"https://api.github.com/repos/rspec/rspec-core/events","assignees_url":"https://api.github.com/repos/rspec/rspec-core/assignees{/user}","branches_url":"https://api.github.com/repos/rspec/rspec-core/branches{/branch}","tags_url":"https://api.github.com/repos/rspec/rspec-core/tags","blobs_url":"https://api.github.com/repos/rspec/rspec-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rspec/rspec-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rspec/rspec-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/rspec/rspec-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rspec/rspec-core/statuses/{sha}","languages_url":"https://api.github.com/repos/rspec/rspec-core/languages","stargazers_url":"https://api.github.com/repos/rspec/rspec-core/stargazers","contributors_url":"https://api.github.com/repos/rspec/rspec-core/contributors","subscribers_url":"https://api.github.com/repos/rspec/rspec-core/subscribers","subscription_url":"https://api.github.com/repos/rspec/rspec-core/subscription","commits_url":"https://api.github.com/repos/rspec/rspec-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/rspec/rspec-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/rspec/rspec-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/rspec/rspec-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/rspec/rspec-core/contents/{+path}","compare_url":"https://api.github.com/repos/rspec/rspec-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rspec/rspec-core/merges","archive_url":"https://api.github.com/repos/rspec/rspec-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rspec/rspec-core/downloads","issues_url":"https://api.github.com/repos/rspec/rspec-core/issues{/number}","pulls_url":"https://api.github.com/repos/rspec/rspec-core/pulls{/number}","milestones_url":"https://api.github.com/repos/rspec/rspec-core/milestones{/number}","notifications_url":"https://api.github.com/repos/rspec/rspec-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rspec/rspec-core/labels{/name}","releases_url":"https://api.github.com/repos/rspec/rspec-core/releases{/id}","deployments_url":"https://api.github.com/repos/rspec/rspec-core/deployments","created_at":"2009-06-29T15:41:05Z","updated_at":"2016-09-03T03:08:57Z","pushed_at":"2016-09-06T18:39:45Z","git_url":"git://github.com/rspec/rspec-core.git","ssh_url":"git@github.com:rspec/rspec-core.git","clone_url":"https://github.com/rspec/rspec-core.git","svn_url":"https://github.com/rspec/rspec-core","homepage":"http://relishapp.com/rspec/rspec-core","size":15857,"stargazers_count":774,"watchers_count":774,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":557,"mirror_url":null,"open_issues_count":47,"forks":557,"open_issues":47,"watchers":774,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rspec/rspec-core/pulls/2321"},"html":{"href":"https://github.com/rspec/rspec-core/pull/2321"},"issue":{"href":"https://api.github.com/repos/rspec/rspec-core/issues/2321"},"comments":{"href":"https://api.github.com/repos/rspec/rspec-core/issues/2321/comments"},"review_comments":{"href":"https://api.github.com/repos/rspec/rspec-core/pulls/2321/comments"},"review_comment":{"href":"https://api.github.com/repos/rspec/rspec-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rspec/rspec-core/pulls/2321/commits"},"statuses":{"href":"https://api.github.com/repos/rspec/rspec-core/statuses/12de2abbbaa16d99d3aaec7cd604cec1e5589e9e"}}}}
{"actor":{"display_login":"myronmarston"}}