Class Sprockets::AssetAttributes
In: lib/sprockets/asset_attributes.rb
Parent: Object

`AssetAttributes` is a wrapper similar to `Pathname` that provides some helper accessors.

These methods should be considered internalish.

Methods

Attributes

environment  [R] 
pathname  [R] 

Public Class methods

Public Instance methods

Returns the content type for the pathname. Falls back to `application/octet-stream`.

Returns an `Array` of engine extensions.

    "foo.js.coffee.erb"
    # => [".coffee", ".erb"]

Returns engine classes.

Replaces `$root` placeholder with actual environment root.

Returns `Array` of extension `String`s.

    "foo.js.coffee"
    # => [".js", ".coffee"]

Returns the format extension.

    "foo.js.coffee"
    # => ".js"

Reverse guess logical path for fully expanded path.

This has some known issues. For an example if a file is shaddowed in the path, but is required relatively, its logical path will be incorrect.

Gets digest fingerprint.

    "foo-0aa2105d29558f3eb790d411d7d8fb66.js"
    # => "0aa2105d29558f3eb790d411d7d8fb66"

Injects digest fingerprint into path.

    "foo.js"
    # => "foo-0aa2105d29558f3eb790d411d7d8fb66.js"

Returns all processors to run on the path.

Replaces environment root with `$root` placeholder.

Returns paths search the load path for.

[Validate]