Module: MotherBrain::Cli::Shell

Defined in:
lib/mb/cli/shell.rb,
lib/mb/cli/shell/ext.rb,
lib/mb/cli/shell/basic.rb,
lib/mb/cli/shell/color.rb

Defined Under Namespace

Modules: Ext Classes: Basic, Color

Class Attribute Summary collapse

Class Attribute Details

.shellShell::Basic, Shell::Color

Returns the shell used in the motherbrain CLI. If you are in a Unix platform it will use a colored shell, otherwise it will use a color-less one.



15
16
17
18
19
20
21
22
23
# File 'lib/mb/cli/shell.rb', line 15

def shell
  @shell ||= if ENV['MB_SHELL'] && ENV['MB_SHELL'].size > 0
    Shell.const_get(ENV['MB_SHELL'].capitalize)
  elsif Buff::Platform.windows? && !ENV['ANSICON']
    Shell::Basic
  else
    Shell::Color
  end
end