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)


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

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



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

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



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

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

#find_debug_asset(path) ⇒ Object



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

def find_debug_asset(path)
  nil
end

#integrity(path) ⇒ Object



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

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