Created
July 11, 2011 08:18
-
-
Save michaelsbradleyjr/1075470 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ------------ 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