Sha256: 9c27c39deb70b6195a4d33ce0f4c7db42f537989b16a08f2b7e93abc893df39f

Contents?: true

Size: 720 Bytes

Versions: 18

Compression:

Stored size: 720 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[
      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

18 entries across 18 versions & 1 rubygems

Version Path
karafka-1.2.13 lib/karafka/loader.rb
karafka-1.2.12 lib/karafka/loader.rb
karafka-1.2.11 lib/karafka/loader.rb
karafka-1.2.10 lib/karafka/loader.rb
karafka-1.2.9 lib/karafka/loader.rb
karafka-1.2.8 lib/karafka/loader.rb
karafka-1.2.7 lib/karafka/loader.rb
karafka-1.2.6 lib/karafka/loader.rb
karafka-1.2.5 lib/karafka/loader.rb
karafka-1.2.4 lib/karafka/loader.rb
karafka-1.2.3 lib/karafka/loader.rb
karafka-1.2.2 lib/karafka/loader.rb
karafka-1.2.1 lib/karafka/loader.rb
karafka-1.2.0 lib/karafka/loader.rb
karafka-1.2.0.beta4 lib/karafka/loader.rb
karafka-1.2.0.beta3 lib/karafka/loader.rb
karafka-1.2.0.beta2 lib/karafka/loader.rb
karafka-1.2.0.beta1 lib/karafka/loader.rb