diff options
author | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-06-24 14:21:21 -0300 |
---|---|---|
committer | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-06-24 14:21:21 -0300 |
commit | 4504b1f93f5b279a687674c7094406ea89dbaf31 (patch) | |
tree | 67830785c123d9034c1151b7451082ba0ed6c037 | |
parent | 128cadb429da8330bda4b0a3cdd4ce1608db8dde (diff) | |
download | highline-4504b1f93f5b279a687674c7094406ea89dbaf31.tar.gz |
Delegate HighLine.use_color= and use_color? to
-rwxr-xr-x | lib/highline.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/highline.rb b/lib/highline.rb index 587e30c..53a4bf7 100755 --- a/lib/highline.rb +++ b/lib/highline.rb @@ -44,12 +44,9 @@ class HighLine include BuiltinStyles include CustomErrors - # The setting used to disable color output. - @use_color = true - # Pass +false+ to _setting_ to turn off HighLine's color escapes. def self.use_color=( setting ) - @use_color = setting + $terminal.use_color = setting end # Set it to false to disable ANSI coloring @@ -57,7 +54,7 @@ class HighLine # Returns true if HighLine is currently using color escapes. def self.use_color? - @use_color + $terminal.use_color? end # Returns true if HighLine instance is currently using color escapes. |