Sha256: 0afd826fdb4f70b4b7846490c09b58e5d01fef1ae8811abb2d9fd8d73de66331

Contents?: true

Size: 1.24 KB

Versions: 18

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

%w[
  karafka
  roda
  etc
  open3
].each { |lib| require lib }

module Karafka
  # Karafka Web UI + Karafka web monitoring
  module Web
    class << self
      # @return [String] root path of this gem
      def gem_root
        Pathname.new(File.expand_path('../..', __dir__))
      end

      # Sets up the whole configuration
      # @param [Block] block configuration block
      def setup(&block)
        Config.configure(&block)
      end

      # @return [Karafka::Web::Config] config instance
      def config
        Config.config
      end

      # Activates all the needed routing and sets up listener, etc
      # This needs to run **after** the optional configuration of the web component
      def enable!
        Installer.new.enable!
      end
    end
  end
end

loader = Zeitwerk::Loader.new
# Make sure pro is not loaded unless Pro
loader.ignore(Karafka::Web.gem_root.join('lib/karafka/web/ui/pro'))

# If license is detected, we can use loader without limitations
Karafka::Licenser.detect do
  loader = Zeitwerk::Loader.new
end

root = File.expand_path('..', __dir__)
loader.tag = 'karafka-web'
loader.inflector = Zeitwerk::GemInflector.new("#{root}/karafka/web.rb")
loader.push_dir(root)

loader.setup
loader.eager_load

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
karafka-web-0.6.3 lib/karafka/web.rb
karafka-web-0.6.2 lib/karafka/web.rb
karafka-web-0.6.1 lib/karafka/web.rb
karafka-web-0.6.0 lib/karafka/web.rb
karafka-web-0.5.2 lib/karafka/web.rb
karafka-web-0.5.1 lib/karafka/web.rb
karafka-web-0.5.0 lib/karafka/web.rb
karafka-web-0.4.1 lib/karafka/web.rb
karafka-web-0.4.0 lib/karafka/web.rb
karafka-web-0.3.1 lib/karafka/web.rb
karafka-web-0.3.0 lib/karafka/web.rb
karafka-web-0.2.5 lib/karafka/web.rb
karafka-web-0.2.4 lib/karafka/web.rb
karafka-web-0.2.3 lib/karafka/web.rb
karafka-web-0.2.2 lib/karafka/web.rb
karafka-web-0.2.1 lib/karafka/web.rb
karafka-web-0.2.0 lib/karafka/web.rb
karafka-web-0.1.3 lib/karafka/web.rb