Class: Hanami::Assets::Bundler Private
- Inherits:
-
Object
- Object
- Hanami::Assets::Bundler
- Defined in:
- lib/hanami/assets/bundler.rb,
lib/hanami/assets/bundler/asset.rb,
lib/hanami/assets/bundler/compressor.rb,
lib/hanami/assets/bundler/manifest_entry.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Bundle assets from a single application.
Defined Under Namespace
Classes: Asset, Compressor, ManifestEntry
Constant Summary collapse
- DEFAULT_PERMISSIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
0o644
- URL_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'/'.freeze
- URL_REPLACEMENT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
''.freeze
Instance Method Summary collapse
-
#initialize(configuration, duplicates) ⇒ Hanami::Assets::Bundler
constructor
private
Return a new instance.
-
#run ⇒ Object
private
Start the process.
Constructor Details
#initialize(configuration, duplicates) ⇒ Hanami::Assets::Bundler
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return a new instance
38 39 40 41 42 |
# File 'lib/hanami/assets/bundler.rb', line 38 def initialize(configuration, duplicates) @manifest = Hash[] @configuration = configuration @duplicates = duplicates end |
Instance Method Details
#run ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Start the process.
For each asset contained in the sources and third party gems, it will:
* Compress
* Create a fingerprinted version of the file
* Generate a subresource integrity digest
At the end it will generate a manifest
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/hanami/assets/bundler.rb', line 57 def run assets.each do |path| unless File.directory?(path) configuration = _configuration_for(path) process(Asset.new(path, configuration)) end end write_manifest_file end |