Sha256: fea5120e08b3ad112039c8a2608257592b752ccbd7ecd4feb6af9c6551f4c270

Contents?: true

Size: 746 Bytes

Versions: 9

Compression:

Stored size: 746 Bytes

Contents

# frozen_string_literal: true

module Karafka
  # Loader for requiring all the files in a proper order
  module Loader
    # Order in which we want to load app files
    DIRS = %w[
      config/initializers
      lib
      app
    ].freeze

    # Will load files in a proper order (based on DIRS)
    # @param [String] root path from which we want to start
    def self.load(root)
      DIRS.each do |dir|
        path = File.join(root, dir)
        next unless File.exist?(path)
        load!(path)
      end
    end

    # Requires all the ruby files from one path in a proper order
    # @param path [String] path (dir) from which we want to load ruby files in a proper order
    def self.load!(path)
      require_all(path)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
karafka-1.1.2 lib/karafka/loader.rb
karafka-1.1.1 lib/karafka/loader.rb
karafka-1.1.0 lib/karafka/loader.rb
karafka-1.1.0.alpha2 lib/karafka/loader.rb
karafka-1.1.0.alpha1 lib/karafka/loader.rb
karafka-1.0.1 lib/karafka/loader.rb
karafka-1.0.0 lib/karafka/loader.rb
karafka-1.0.0.rc1 lib/karafka/loader.rb
karafka-0.6.0.rc2 lib/karafka/loader.rb