Class: Sprockets::ProcessedAsset
- Inherits:
-
AssetWithDependencies
- Object
- Asset
- AssetWithDependencies
- Sprockets::ProcessedAsset
- Defined in:
- lib/turbo-sprockets/sprockets_overrides/processed_asset.rb
Instance Attribute Summary
Attributes inherited from AssetWithDependencies
Instance Method Summary collapse
-
#initialize(environment, logical_path, pathname) ⇒ ProcessedAsset
constructor
A new instance of ProcessedAsset.
Methods inherited from AssetWithDependencies
#encode_with, #fresh?, #init_with
Constructor Details
#initialize(environment, logical_path, pathname) ⇒ ProcessedAsset
Returns a new instance of ProcessedAsset.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/turbo-sprockets/sprockets_overrides/processed_asset.rb', line 11 def initialize(environment, logical_path, pathname) super start_time = Time.now.to_f context = environment.context_class.new(environment, logical_path, pathname) @source = context.evaluate(pathname) @length = Rack::Utils.bytesize(source) @digest = environment.digest.update(source).hexdigest build_required_assets(environment, context) build_dependency_paths(environment, context) @dependency_digest = compute_dependency_digest(environment) elapsed_time = ((Time.now.to_f - start_time) * 1000).to_i environment.logger.info "Compiled #{logical_path} (#{elapsed_time}ms) (pid #{Process.pid})" end |