I’m using the Rails3 asset pipeline for js. I’d like to wrap some third-party libs in a namspace, but I can’t get it to work. For example, this
var myns= function() {
//= require swfobject
};
produces literally:
var myns= function() {
//= require swfobject
};
That is, the require wasn’t invoked. Is the asset pipeline syntax so fragile? Where is this limitation documented? Is there a workaround or better way?
First time I see this use case of assets pipeline.
Anyway you should check the sprockets documentation https://github.com/sstephenson/sprockets (The Directive Processor)