Skip to content

Instantly share code, notes, and snippets.

@sebs
Forked from papandreou/gist:774412
Created January 11, 2011 15:36
Show Gist options
  • Save sebs/774567 to your computer and use it in GitHub Desktop.
Save sebs/774567 to your computer and use it in GitHub Desktop.
var fs = require('fs'),
step = require('step'),
jsdom = require('jsdom'),
window = jsdom.createWindow(),
Script = process.binding('evals').Script;
window.document = {};
window.Ext = {data:{Record:{}}};
var fileNames = [
'platform/src/Ext.js',
'platform/src/util/Observable.js',
'platform/src/util/Stateful.js',
'platform/src/util/HashMap.js',
'platform/src/util/MixedCollection.js',
'platform/src/util/AbstractManager.js',
'platform/src/util/DelayedTask.js',
'platform/src/util/GeoLocation.js',
'platform/src/util/Point.js',
'platform/src/util/Offset.js',
'platform/src/util/Region.js',
'platform/src/util/Template.js',
'platform/src/util/XTemplate.js',
'platform/src/util/Sorter.js',
'platform/src/util/Filter.js',
'platform/src/util/Function.js',
'platform/src/util/Date.js',
'platform/src/util/Number.js',
'platform/src/util/Format.js',
'platform/src/util/LoadMask.js',
// Platform Native
'platform/src/native/Array.js',
// Platform Core
'platform/src/ComponentMgr.js',
'platform/src/ComponentQuery.js',
'platform/src/PluginMgr.js',
'platform/src/EventManager.js',
'platform/src/Support.js',
// Platform MVC
'core/History.js',
'platform/src/app/ControllerManager.js',
'platform/src/app/Controller.js',
'platform/src/app/Dispatcher.js',
'platform/src/app/Router.js',
'platform/src/app/Route.js',
'platform/src/app/Interaction.js',
'platform/src/app/Application.js',
'platform/src/app/ApplicationManager.js',
// Data Foundation
'platform/src/data/Batch.js',
'platform/src/data/Model.js',
'platform/src/data/Association.js',
'platform/src/data/HasManyAssociation.js',
'platform/src/data/BelongsToAssociation.js',
'platform/src/data/PolymorphicAssociation.js',
'platform/src/data/Validations.js',
'platform/src/data/Errors.js',
'platform/src/data/Field.js',
'platform/src/data/SortTypes.js',
'platform/src/data/Types.js',
'platform/src/data/ModelMgr.js',
'platform/src/data/Operation.js',
'platform/src/data/ProxyMgr.js',
'platform/src/data/ReaderMgr.js',
'platform/src/data/Request.js',
'platform/src/data/ResultSet.js',
'platform/src/data/stores/AbstractStore.js',
'platform/src/data/Store.js',
'platform/src/data/stores/TreeStore.js',
'platform/src/data/StoreMgr.js',
'platform/src/data/WriterMgr.js',
'platform/src/data/Tree.js',
'platform/src/data/Node.js',
'platform/src/data/proxies/Proxy.js',
'platform/src/data/proxies/ServerProxy.js',
'platform/src/data/proxies/AjaxProxy.js',
'platform/src/data/proxies/RestProxy.js',
'platform/src/data/proxies/ScriptTagProxy.js',
'platform/src/data/proxies/ClientProxy.js',
'platform/src/data/proxies/MemoryProxy.js',
'platform/src/data/proxies/WebStorageProxy.js',
'platform/src/data/proxies/LocalStorageProxy.js',
'platform/src/data/proxies/SessionStorageProxy.js',
'platform/src/data/readers/Reader.js',
'platform/src/data/writers/Writer.js',
// Data - Json
'platform/src/data/writers/JsonWriter.js',
'platform/src/data/readers/JsonReader.js',
'platform/src/data/readers/TreeReader.js',
'platform/src/data/readers/ArrayReader.js',
'platform/src/data/stores/ArrayStore.js',
'platform/src/data/stores/JsonStore.js',
'platform/src/data/stores/JsonPStore.js',
// Data - XML
'platform/src/data/writers/XmlWriter.js',
'platform/src/data/readers/XmlReader.js',
'platform/src/data/stores/XmlStore.js'
];
step(
function () {
var group = this.group();
fileNames.forEach(function (fileName) {
fs.readFile(fileName, 'utf8', group());
});
},
function (err, fileBodies) {
if (err) {
console.log("Error: " + err);
process.exit();
}
fileBodies.forEach(function (fileBody, i) {
console.log("Evaling " + fileNames[i]);
Script.runInNewContext(fileBody, window);
});
console.log("The Ext object = " + require('sys').inspect(window.Ext));
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment