require "rbconfig"
class Bundler::Thor
module Base
class << self
attr_writer :shell
# Returns the shell used in all Bundler::Thor classes. If you are in a Unix platform
# it will use a colored log, otherwise it will use a basic one without color.
#
def shell
@shell ||= if ENV["THOR_SHELL"] && !ENV["THOR_SHELL"].empty?
Bundler::Thor::Shell.const_get(ENV["THOR_SHELL"])
elsif RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ && !ENV["ANSICON"]
Bundler::Thor::Shell::Basic
else
Bundler::Thor::Shell::Color
end
end
end
end
module Shell
SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
attr_writer :shell
autoload :Basic, File.expand_path("shell/basic", __dir__)
autoload :Color, File.expand_path("shell/color", __dir__)
autoload :HTML, File.expand_path("shell/html", __dir__)
# Add shell to initialize config values.
#
# ==== Configuration
# shell