lib/hanami/assets/precompiler.rb in hanami-assets-0.2.0 vs lib/hanami/assets/precompiler.rb in hanami-assets-0.2.1

- old
+ new

@@ -37,19 +37,24 @@ private # @since 0.1.0 # @api private def clear_public_directory - public_directory = Hanami::Assets.configuration.public_directory + public_directory = @configuration.public_directory public_directory.rmtree if public_directory.exist? end # @since 0.1.0 # @api private def precompile applications.each do |duplicate| - config = duplicate.configuration + config = if duplicate.respond_to?(:configuration) + duplicate.configuration + else + duplicate + end + config.compile true config.files.each do |file| Compiler.compile(config, file) end @@ -58,10 +63,10 @@ # @since 0.1.0 # @api private def applications @duplicates.empty? ? - [Hanami::Assets] : @duplicates + [@configuration] : @duplicates end end end end