Class: Sprockets::Rails::HelperAssetResolvers::Manifest

Inherits:
Object
  • Object
show all
Defined in:
lib/sprockets/rails/helper.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(view) ⇒ Manifest

Returns a new instance of Manifest.

Raises:

  • (ArgumentError)


282
283
284
285
# File 'lib/sprockets/rails/helper.rb', line 282

def initialize(view)
  @manifest = view.assets_manifest
  raise ArgumentError, 'config.assets.resolve_with includes :manifest, but app.assets_manifest is nil' unless @manifest
end

Instance Method Details

#asset_path(path, digest, allow_non_precompiled = false) ⇒ Object



287
288
289
290
291
# File 'lib/sprockets/rails/helper.rb', line 287

def asset_path(path, digest, allow_non_precompiled = false)
  if digest
    digest_path path, allow_non_precompiled
  end
end

#digest_path(path, allow_non_precompiled = false) ⇒ Object



293
294
295
# File 'lib/sprockets/rails/helper.rb', line 293

def digest_path(path, allow_non_precompiled = false)
  @manifest.assets[path]
end

#find_debug_asset(path) ⇒ Object



303
304
305
# File 'lib/sprockets/rails/helper.rb', line 303

def find_debug_asset(path)
  nil
end

#integrity(path) ⇒ Object



297
298
299
300
301
# File 'lib/sprockets/rails/helper.rb', line 297

def integrity(path)
  if meta = (path)
    meta["integrity"]
  end
end