Skip to content

Instantly share code, notes, and snippets.

@michaelsbradleyjr
Created July 11, 2011 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelsbradleyjr/1075470 to your computer and use it in GitHub Desktop.
Save michaelsbradleyjr/1075470 to your computer and use it in GitHub Desktop.
/* ------------ START BOILERPLATE ------------ */
;(function () {
function runner(getExpectedNS /* [NS1], [NS2], [...] */) {
expectedNS = ['Joose', 'MyNS']
if (getExpectedNS) { return expectedNS }
/* ------------ START YOUR COMPONENT SCRIPT ------------ */
// populate expectedNS above with top-level namespaces ref'd in your code
Joose.Role('MyNS.MyRole', {
...
})
/* ------------ END YOUR COMPONENT SCRIPT ------------ */
}
if (Joose) {
// this case for component scripts concat'd in a dzil build
runner()
} else if (Boolean(typeof process != 'undefined' && process.pid)) {
// NodeJS case
module.exports = runner
} else {
// this case for components pulled down through simple request and eval'd
return runner
}
})()
/* ------------ END BOILERPLATE ------------ */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment