Sha256: 8d51def319e5be0c7318b9c65acaf8dadc1205881413bcf7329c14fa05fa37c2

Contents?: true

Size: 961 Bytes

Versions: 15

Compression:

Stored size: 961 Bytes

Contents

require 'hanami/utils'

module Hanami
  # @api private
  module Config
    # Define the load paths where the application should load
    #
    # @since 0.1.0
    # @api private
    class LoadPaths < Utils::LoadPaths
      # Overrides Utils::LoadPath initialize method
      #
      # @see Hanami::Utils::LoadPaths#initialize
      #
      # @since 0.1.0
      # @api private
      def initialize(root)
        super()
        @root = root
      end

      # Requires relative @pats [Utils::Kernel.Array] variable via each method
      #
      # @see Hanami::Utils::LoadPaths#each
      #
      # @since 0.1.0
      # @api private
      def load!
        each do |path|
          Utils.require!(path)
        end
      end

      protected

      # Overrides Utils::LoadPath realpath method
      #
      # @see Hanami::Utils::LoadPaths#realpath
      #
      # @api private
      def realpath(path)
        @root.join(path).realpath
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hanami-1.3.5 lib/hanami/config/load_paths.rb
hanami-1.3.4 lib/hanami/config/load_paths.rb
hanami-1.3.3 lib/hanami/config/load_paths.rb
hanami-1.3.2 lib/hanami/config/load_paths.rb
hanami-1.3.1 lib/hanami/config/load_paths.rb
hanami-1.3.0 lib/hanami/config/load_paths.rb
hanami-1.3.0.beta1 lib/hanami/config/load_paths.rb
hanami-1.2.0 lib/hanami/config/load_paths.rb
hanami-1.2.0.rc2 lib/hanami/config/load_paths.rb
hanami-1.2.0.rc1 lib/hanami/config/load_paths.rb
hanami-1.2.0.beta2 lib/hanami/config/load_paths.rb
hanami-1.2.0.beta1 lib/hanami/config/load_paths.rb
hanami-1.1.1 lib/hanami/config/load_paths.rb
hanami-1.1.0 lib/hanami/config/load_paths.rb
hanami-1.1.0.rc1 lib/hanami/config/load_paths.rb