sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::Manifest#exporters_for_asset

Given an asset, finds all exporters that
match its mime-type.

Will yield each expoter to the passed in block.

    array = []
    puts asset.content_type # => "application/javascript"
    exporters_for_asset(asset) do |exporter|
      array << exporter
    end
    # puts array => [Exporters::FileExporter, Exporters::ZlibExporter]

Source | Google | Stack overflow

Edit

git clone [email protected]:rails/sprockets.git

cd sprockets

open lib/sprockets/manifest.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--Manifest-exporters_for_asset-for-pr


# Commit to git

git add lib/sprockets/manifest.rbgit commit -m "better docs for Sprockets::Manifest#exporters_for_asset"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Sprockets--Manifest-exporters_for_asset-for-pr

hub pull-request


# Celebrate!