Class: MotherBrain::Cli::Base

Inherits:
Thor
  • Object
show all
Includes:
MB::Mixin::CodedExit, MB::Mixin::Services, Thor::Actions
Defined in:
lib/mb/cli/base.rb

Class Method Summary collapse

Class Method Details

.register_subcommand(klass) ⇒ Object

Registers a SubCommand with this Cli::Base class

Parameters:

  • klass (MB::Cli::SubCommand)


12
13
14
# File 'lib/mb/cli/base.rb', line 12

def register_subcommand(klass)
  self.register(klass, klass.name.gsub('-', '_'), klass.usage.gsub('-', '_'), klass.description)
end

.uiMB::Cli::Shell::Color, MB::Cli::Shell::Basic

Returns:

  • (MB::Cli::Shell::Color, MB::Cli::Shell::Basic)


17
18
19
# File 'lib/mb/cli/base.rb', line 17

def ui
  @ui ||= MB::Cli::Shell.shell.new
end