lib/hanami/assets/precompiler.rb in hanami-assets-1.3.4 vs lib/hanami/assets/precompiler.rb in hanami-assets-1.3.5
- old
+ new
@@ -1,8 +1,10 @@
-require 'fileutils'
-require 'hanami/assets/compiler'
+# frozen_string_literal: true
+require "fileutils"
+require "hanami/assets/compiler"
+
module Hanami
module Assets
# Precompile all the assets, coming from all the applications and third
# party gems into the public directory of the project.
#
@@ -46,21 +48,21 @@
# @since 0.3.0
# @api private
def clear_manifest(manifest)
JSON.parse(manifest).each_value do |asset_hash|
- asset_file_name = @configuration.public_directory.join(asset_hash['target'])
+ asset_file_name = @configuration.public_directory.join(asset_hash["target"])
asset_file_name.unlink if asset_file_name.exist?
end
rescue JSON::ParserError
- warn 'Non JSON manifest found and unlinked.'
+ warn "Non JSON manifest found and unlinked."
ensure
manifest.unlink
end
# @since 0.1.0
# @api private
- def precompile # rubocop:disable Metrics/MethodLength
+ def precompile
applications.each do |duplicate|
config = if duplicate.respond_to?(:configuration)
duplicate.configuration
else
duplicate