class Karafka::Cli

Karafka framework Cli If you want to add/modify command that belongs to CLI, please review all commands available in cli/ directory inside Karafka source code.

@note Whole Cli is built using Thor @see github.com/erikhuda/thor

Karafka framework Cli

Karafka framework Cli

Karafka framework Cli

Karafka framework Cli

Karafka framework Cli

Public Class Methods

exit_on_failure?() click to toggle source

When there is a CLI crash, exit @return [true]

# File lib/karafka/cli.rb, line 27
def exit_on_failure?
  true
end
prepare() click to toggle source

Loads all Cli commands into Thor framework This method should be executed before we run Karafka::Cli.start, otherwise we won't have any Cli commands available

# File lib/karafka/cli.rb, line 19
def prepare
  cli_commands.each do |action|
    action.bind_to(self)
  end
end

Private Class Methods

cli_commands() click to toggle source

@return [Array<Class>] Array with Cli action classes that can be used as commands

# File lib/karafka/cli.rb, line 34
def cli_commands
  constants
    .map! { |object| const_get(object) }
    .keep_if do |object|
      object.instance_of?(Class) && (object < Cli::Base)
    end
end