sstephenson/sprockets — Issue #225: Expected inline-require to work
Author: grimen
Created: 2011-10-14 17:02:45+00:00
State: open

I expected this to work, but didn't - is there any way of doing this with Sprockets?

Output from Sprockets, but you can see what I'm aiming for here.

```javascript
MyLib = MyLib || {};

MyLib.isPresent = MyLib.isPresent || function(obj) {
return (typeof obj !== 'undefined' && obj !== null);
}

MyLib.dependencies = MyLib.dependencies || {
jquery: {
version: '1.6.2'
},
jquery_ui: {
version: '1.8.14'
}
}

if (MyLib.isPresent(window.jQuery) && window.jQuery.fn.jquery >= MyLib.dependencies.jquery.version) {
//= require jquery
}

if (MyLib.isPresent(window.jQuery.ui) && window.jQuery.ui.version >= MyLib.dependencies.jquery_ui.version) {
//= require jquery_ujs
}
;
```