diff options
author | Pete Higgins <pete@peterhiggins.org> | 2017-06-23 16:06:35 -0700 |
---|---|---|
committer | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-06-25 01:13:25 -0300 |
commit | 09bf55b401ee1d6082f15dffc8b460d7c7c71732 (patch) | |
tree | a09820fd8ae5968fced9a05306f2ebdfc4399701 /lib/highline.rb | |
parent | 84d2a24e83e069069d09ff02460446a0a67e28e6 (diff) | |
download | highline-09bf55b401ee1d6082f15dffc8b460d7c7c71732.tar.gz |
Add method to reset use_color setting.
Diffstat (limited to 'lib/highline.rb')
-rwxr-xr-x | lib/highline.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/highline.rb b/lib/highline.rb index 33ae934..8476bcc 100755 --- a/lib/highline.rb +++ b/lib/highline.rb @@ -52,6 +52,14 @@ class HighLine @use_color end + # Resets the use of color. + def self.reset_use_color + @use_color = true + end + + # Use color output by default. + reset_use_color + # For checking if the current version of HighLine supports RGB colors # Usage: HighLine.supports_rgb_color? rescue false # rescue for compatibility with older versions # Note: color usage also depends on HighLine.use_color being set @@ -96,10 +104,11 @@ class HighLine end # Reset HighLine to default. - # Clears Style index and reset color scheme. + # Clears Style index and resets color_scheme and use_color settings. def self.reset Style.clear_index reset_color_scheme + reset_use_color end # Reset color scheme to default (+nil+) |