Sha256: d7d34f099fb6c9716df81112ec20a75e720134465e6ea48127df7ef3e7ba7820
Contents?: true
Size: 856 Bytes
Versions: 2
Compression:
Stored size: 856 Bytes
Contents
# frozen_string_literal: true require "refinements/pathname" module Hanamismith module Extensions # Ensures assets are compiled. class Asset include Dependencies[:settings, :kernel, :logger] using Refinements::Pathname def call logger.error { "Unable to compile assets. Try: `hanami assets compile`." } unless run true end private def run success = false settings.project_root.change_dir { success = compile_app && compile_home } success end def compile_app kernel.system "node config/assets.js -- --path=app --dest=public/assets > /dev/null 2>&1" end def compile_home kernel.system( "node config/assets.js -- --path=slices/home --dest=public/assets/_home > /dev/null 2>&1" ) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hanamismith-1.1.0 | lib/hanamismith/extensions/asset.rb |
hanamismith-1.0.0 | lib/hanamismith/extensions/asset.rb |