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