lib/bundler/ui/shell.rb in bundler-2.0.2 vs lib/bundler/ui/shell.rb in bundler-2.1.0.pre.1

- old
+ new

@@ -1,20 +1,18 @@ # frozen_string_literal: true -require "bundler/vendored_thor" +require_relative "../vendored_thor" module Bundler module UI class Shell LEVELS = %w[silent error warn confirm info debug].freeze attr_writer :shell def initialize(options = {}) - if options["no-color"] || !$stdout.tty? - 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 = [] end @@ -33,17 +31,15 @@ def warn(msg, newline = nil) return unless level("warn") return if @warning_history.include? msg @warning_history << msg - return tell_err(msg, :yellow, newline) if Bundler.feature_flag.error_on_stderr? - tell_me(msg, :yellow, newline) + tell_err(msg, :yellow, newline) end def error(msg, newline = nil) return unless level("error") - return tell_err(msg, :red, newline) if Bundler.feature_flag.error_on_stderr? - tell_me(msg, :red, newline) + tell_err(msg, :red, newline) end def debug(msg, newline = nil) tell_me(msg, nil, newline) if debug? end