summaryrefslogtreecommitdiff
path: root/lib/bundler/ui
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-24 20:28:25 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-03 09:29:55 +0900
commit580e165873c727b9248e1ba7d3ac0af9b121a235 (patch)
tree58675d7d45efbb51cb9305d09916972f261e7edd /lib/bundler/ui
parentb95756c7a998311a2d4bbee94530c6ad83ab7d06 (diff)
downloadruby-580e165873c727b9248e1ba7d3ac0af9b121a235.tar.gz
[bundler/bundler] Respect color option when instantiating shells
Thor's base shell will be memoized the first time it is set. So if we instantiate a no-color shell first, further instantiations of a bundler shell will be initialized with a no-color shell by default. This is caused some sources specs to fail, depending on the order they run. See for example https://travis-ci.org/bundler/bundler/builds/500328994. What we do to fix it is to reset the shell unless no-color is explicitly specified. That way, further instantiations will rerun thor's internal logic to choose the default shell. https://github.com/bundler/bundler/commit/786b5d9894
Diffstat (limited to 'lib/bundler/ui')
-rw-r--r--lib/bundler/ui/shell.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb
index 35da1edfc7..92476be7d2 100644
--- a/lib/bundler/ui/shell.rb
+++ b/lib/bundler/ui/shell.rb
@@ -10,9 +10,7 @@ module Bundler
attr_writer :shell
def initialize(options = {})
- if options["no-color"]
- Thor::Base.shell = Thor::Shell::Basic
- end
+ Thor::Base.shell = options["no-color"] ? Thor::Shell::Basic : nil
@shell = Thor::Base.shell.new
@level = ENV["DEBUG"] ? "debug" : "info"
@warning_history = []