Class: Hanami::CLI::Commands::App::Assets::Compile

Inherits:
Command
  • Object
show all
Defined in:
lib/hanami/cli/commands/app/assets/compile.rb

Instance Method Summary collapse

Methods inherited from Command

#call, #initialize

Constructor Details

This class inherits a constructor from Hanami::CLI::Commands::App::Assets::Command

Instance Method Details

#execute_assets_command(assets, output_dir) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/hanami/cli/commands/app/assets/compile.rb', line 11

def execute_assets_command(assets, output_dir)
  out.puts "Compiling assets using Sprockets..."

  manifest = assets.precompile(output_dir)

  out.puts "Assets compiled successfully:"
  manifest.assets.each do |logical_path, digest_path|
    out.puts "  #{logical_path} -> #{digest_path}"
  end

  out.puts "Output directory: #{output_dir}"
rescue => e
  out.puts "Error compiling assets: #{e.message}"
  raise
end