This repository was archived by the owner on Nov 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 753
Issue 2020 remove ansicon warning #2038
Merged
myronmarston
merged 2 commits into
rspec:master
from
weedySeaDragon:issue-2020--remove-ANSICON-warning
Jul 28, 2015
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Feature: Windows may require additional solutions to display color | ||
|
||
The output uses [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) to show text in color. Windows | ||
systems (shells) often don't interpret those codes at all. | ||
|
||
If you're on Windows and you see ANSI escape codes in the output | ||
(something like `[1m [31m` ) and your text isn't in different colors, | ||
you may need to install a utility so that your Windows shell will | ||
interpret those codes correctly and show the colors. Here are some | ||
popular solutions: | ||
|
||
* [ANSICON](https://github.com/adoxa/ansicon): ANSICON runs 'on top of' cmd or powershell. This is a very | ||
popular solution. You can set it up so that it's always used whenever | ||
you use cmd or powershell, or use it only at specific times. | ||
|
||
* Alternatives to cmd.exe or powershell: [ConEmu](http://conemu.github.io/), [Console2](http://sourceforge.net/projects/console/), | ||
[ConsoleZ](https://github.com/cbucher/console) | ||
|
||
* Unix-like shells and utilities: [cygwin](https://www.cygwin.com/), [babun](http://babun.github.io/index.html), | ||
[MinGW](http://www.mingw.org/) (Minimalist GNU for Windows) | ||
|
||
To find out more, search for information about those solutions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -695,9 +695,7 @@ def full_backtrace=(true_or_false) | |
# | ||
# @see color_enabled? | ||
# @return [Boolean] | ||
def color | ||
value_for(:color) { @color } | ||
end | ||
attr_writer :color | ||
|
||
# Check if color is enabled for a particular output. | ||
# @param output [IO] an output stream to use, defaults to the current | ||
|
@@ -711,15 +709,7 @@ def color_enabled?(output=output_stream) | |
# @attr true_or_false [Boolean] toggle color enabled | ||
def color=(true_or_false) | ||
return unless true_or_false | ||
|
||
if RSpec::Support::OS.windows? && !ENV['ANSICON'] | ||
RSpec.warning "You must use ANSICON 1.31 or later " \ | ||
"(http://adoxa.3eeweb.com/ansicon/) to use colour " \ | ||
"on Windows" | ||
@color = false | ||
else | ||
@color = true | ||
end | ||
@color = !!true_or_false | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that this method can be replaced by a simpler There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. I didn't know if that method needed to hang around or not. I'll change it to |
||
|
||
# @private | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a replacement for the
def color=
method, not thedef color
method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh how embarrassing. (:head_smack:) Fixed.