Sha256: 0dad238fc6c7bc8e409e6515fd255a262932858189d441aaf72910cf20e86ba7

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

# frozen_string_literal: true

module Hanami
  # @api private
  module Providers
    # Provider source to register routes helper component in Hanami slices.
    #
    # @see Hanami::Slice::RoutesHelper
    #
    # @api private
    # @since 2.0.0
    class Assets < Dry::System::Provider::Source
      # @api private
      def prepare
        require "hanami/assets"
      end

      # @api private
      def start
        root = target.app.root.join("public", "assets", Hanami::Assets.public_assets_dir(target).to_s)

        assets = Hanami::Assets.new(config: target.config.assets, root: root)

        register(:assets, assets)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hanami-2.2.0.beta1 lib/hanami/providers/assets.rb