Sha256: f56d64f948004d9c3fffdfd2c52fc3edd0c03bab0fab1119669851233a57c138

Contents?: true

Size: 1.01 KB

Versions: 24

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby

require 'karafka'

# We set this to indicate, that the process in which we are (whatever it does) was started using
# our bin/karafka cli
ENV['KARAFKA_CLI'] = 'true'

# If there is a boot file, we need to require it as we expect it to contain
# Karafka app setup, routes, etc
if File.exist?(Karafka.boot_file)
  rails_env_rb = File.join(Dir.pwd, 'config/environment.rb')

  # Load Rails environment file that starts Rails, so we can reference consumers and other things
  # from `karafka.rb` file. This will work only for Rails, for non-rails a manual setup is needed
  require rails_env_rb if Kernel.const_defined?(:Rails) && File.exist?(rails_env_rb)

  require Karafka.boot_file.to_s
else
  # However when it is unavailable, we still want to be able to run help command
  # and install command as they don't require configured app itself to run
  raise(
    Karafka::Errors::MissingBootFileError,
    Karafka.boot_file
  ) unless %w[-h install].include?(ARGV[0])
end

Karafka::Cli.prepare
Karafka::Cli.start

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
karafka-2.0.28 bin/karafka
karafka-2.0.27 bin/karafka
karafka-2.0.26 bin/karafka
karafka-2.0.24 bin/karafka
karafka-2.0.23 bin/karafka
karafka-2.0.22 bin/karafka
karafka-2.0.21 bin/karafka
karafka-2.0.20 bin/karafka
karafka-2.0.19 bin/karafka
karafka-2.0.18 bin/karafka
karafka-2.0.17 bin/karafka
karafka-2.0.16 bin/karafka
karafka-2.0.15 bin/karafka
karafka-2.0.14 bin/karafka
karafka-2.0.13 bin/karafka
karafka-2.0.12 bin/karafka
karafka-2.0.11 bin/karafka
karafka-2.0.10 bin/karafka
karafka-2.0.9 bin/karafka
karafka-2.0.8 bin/karafka