Sha256: c883c921300d3f5f809eea408a44642d47093e62ab89d86390326ce3097178d8
Contents?: true
Size: 1.69 KB
Versions: 19
Compression:
Stored size: 1.69 KB
Contents
module Hanami # @since 0.9.0 # @api private module Components # @since 0.9.0 # @api private module App # hanami-assets configuration for a sigle Hanami application in the project. # # @since 0.9.0 # @api private class Assets # Configure hanami-assets for a single Hanami application in the project. # # @param app [Hanami::Configuration::App] a Hanami application # # @since 0.9.0 # @api private # # rubocop:disable Metrics/AbcSize # rubocop:disable Metrics/MethodLength def self.resolve(app) config = app.configuration namespace = app.namespace unless namespace.const_defined?('Assets', false) assets = Hanami::Assets.duplicate(namespace) do root config.root scheme config.scheme host config.host port config.port public_directory Hanami.public_directory prefix Utils::PathPrefix.new('/assets').join(config.path_prefix) manifest Hanami.public_directory.join('assets.json') compile true config.assets.__apply(self) end assets.configure do cdn host != config.host end namespace.const_set('Assets', assets) end name = "#{app.app_name}.assets" Components.resolved(name, namespace.const_get('Assets').configuration) Components[name] end end # rubocop:enable Metrics/MethodLength # rubocop:enable Metrics/AbcSize end end end
Version data entries
19 entries across 19 versions & 1 rubygems