Method: Thor::Base.shell

Defined in:
lib/thor/shell.rb

.shellObject

Returns the shell used in all Thor classes. If you are in a Unix platform it will use a colored log, otherwise it will use a basic one without color.



11
12
13
14
15
16
17
18
19
# File 'lib/thor/shell.rb', line 11

def shell
  @shell ||= if ENV["THOR_SHELL"] && !ENV["THOR_SHELL"].empty?
    Thor::Shell.const_get(ENV["THOR_SHELL"])
  elsif RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ && !ENV["ANSICON"]
    Thor::Shell::Basic
  else
    Thor::Shell::Color
  end
end