Closed fxposter closed 14 years ago
Without a reason to subclass Jammit::Packager
, I think this is a wontfix. If there's a particular configuration option you'd like to add, we should talk about that.
We use this to enable "dynamic packaging". Sometimes we have a javascripts that we need to use only on one page and we really don't want to check, if it breaks something on other pages.
class MyPackager < Jammit::Packager
def not_found(package, extension)
dynamic_package_for(package, extension) || super
end
def dynamic_package_for(package, extension)
dir = extension == :js ? "javascripts" : "stylesheets"
url = "#{package}.#{extension}"
path = "public/#{dir}/#{url}"
{ :paths => [path], :urls => [url] }
end
end
Now the user is able to create a custom packager class:
and point Jammit to use this class by adding a "packager_class" option to assets.yml: