Sha256: feba32f43aad44a82a4fa3d83b688764fa89fbf71e10b9048ed5f3344f5b7910

Contents?: true

Size: 707 Bytes

Versions: 1

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

module Karafka
  # Karafka framework Cli
  class Cli
    # Console Karafka Cli action
    class Console < Base
      desc 'Start the Karafka console (short-cut alias: "c")'
      option aliases: 'c'

      # @return [String] Console executing command
      # @example
      #   Karafka::Cli::Console.command #=> 'KARAFKA_CONSOLE=true bundle exec irb...'
      def self.command
        envs = [
          "IRBRC='#{Karafka.gem_root}/.console_irbrc'",
          'KARAFKA_CONSOLE=true'
        ]
        "#{envs.join(' ')} bundle exec irb"
      end

      # Start the Karafka console
      def call
        cli.info
        system self.class.command
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
karafka-0.6.0.rc1 lib/karafka/cli/console.rb