diff options
author | 0xAB <0xAB@protonmail.com> | 2017-09-01 14:16:34 +0100 |
---|---|---|
committer | 0xAB <0xAB@protonmail.com> | 2017-09-01 14:16:34 +0100 |
commit | ba0b42da63a1949dd3a564bb9e6672472b8c6b26 (patch) | |
tree | 7aa985533314a2abc89e72c2b597b8318ff348c1 | |
parent | 677928293a5a3a9d3043a06e166aa8b950ac9e44 (diff) | |
download | pry-ba0b42da63a1949dd3a564bb9e6672472b8c6b26.tar.gz |
update no_color
-rw-r--r-- | lib/pry/helpers/colors.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pry/helpers/colors.rb b/lib/pry/helpers/colors.rb index 29f0ad1c..de5c2faf 100644 --- a/lib/pry/helpers/colors.rb +++ b/lib/pry/helpers/colors.rb @@ -77,11 +77,11 @@ module Pry::Helpers::Colors # Executes the block with `Pry.config.color` set to false. # @yield # @return [void] - def no_color(&block) - boolean = Pry.config.color - Pry.config.color = false + def no_color pry=(defined?(_pry_) && _pry_) || Pry, &block + boolean = pry.config.color + pry.config.color = false yield ensure - Pry.config.color = boolean + pry.config.color = boolean end end |