Sha256: f36023fb616718201e4d7dbf6fd62c5127a75abba4d6dd9f015d26ab2b7c6d5a

Contents?: true

Size: 506 Bytes

Versions: 5

Compression:

Stored size: 506 Bytes

Contents

require 'hanami/utils/load_paths'

module Hanami
  module Config
    # Define the load paths where the application should load
    #
    # @since 0.1.0
    # @api private
    class LoadPaths < Utils::LoadPaths
      PATTERN = '**/*.rb'.freeze

      def load!(root)
        @root = root

        each do |path|
          Dir.glob(path.join(PATTERN)).each { |file| require file }
        end
      end

      protected
      def realpath(path)
        @root.join(path).realpath
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanami-0.8.0 lib/hanami/config/load_paths.rb
hanami-0.7.3 lib/hanami/config/load_paths.rb
hanami-0.7.2 lib/hanami/config/load_paths.rb
hanami-0.7.1 lib/hanami/config/load_paths.rb
hanami-0.7.0 lib/hanami/config/load_paths.rb