Sha256: e6cef8adb07a433ab3c9d4d3a5c72b2878f5c440a8432e39cfbfc582a09b1323
Contents?: true
Size: 1.01 KB
Versions: 36
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true module Karafka # Karafka framework Cli class Cli < Thor # Console Karafka Cli action class Console < Base desc 'Start the Karafka console (short-cut alias: "c")' option aliases: 'c' class << self # @return [String] Console executing command for non-Rails setup # @example # Karafka::Cli::Console.command #=> 'KARAFKA_CONSOLE=true bundle exec irb...' def console "IRBRC='#{Karafka.gem_root}/.console_irbrc' bundle exec irb -r #{Karafka.boot_file}" end # @return [String] Console executing command for Rails setup # @note In case of Rails, it has its own console, hence we can just defer to it def rails_console 'bundle exec rails console' end end # Start the Karafka console def call cli.info command = ::Karafka.rails? ? self.class.rails_console : self.class.console exec "KARAFKA_CONSOLE=true #{command}" end end end end
Version data entries
36 entries across 36 versions & 1 rubygems