PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/ext-4.0.7/jsbuilder/src/generators/app/files/lib/JSBuilder/bin/Dispatch.js

https://bitbucket.org/srogerf/javascript
JavaScript | 37 lines | 22 code | 8 blank | 7 comment | 0 complexity | 8af4994969de9d2f173d90783f5e4955 MD5 | raw file
 1var JSBuilderPath = system.cwd + '/lib/JSBuilder/';
 2
 3load(JSBuilderPath + 'src/Loader.js');
 4Loader.setBasePath(JSBuilderPath + 'src');
 5
 6Loader.require([
 7    'Ext', 'Cmd', 'Filesystem', 'Platform', 'Cli', 'Logger', 'Project', 'Target', 'Package', 'Build'
 8]);
 9
10/**
11 * @class Ext.CommandDispatcher
12 * @extends Object
13 * Dispaches to the relevant Cli subclass from the command line 'sencha' command. e.g.
14 * sencha generate xyz is dispatched to whichever Ext.Cli subclass registered itself to
15 * handler the 'generate' command (Ext.generator.Factory in this case).
16 */
17Ext.CommandDispatcher = {
18    types: {},
19    
20    dispatch: function(module, args) {
21        new this.types[module]({args: args});
22    }
23};
24
25Ext.regDispatchable = function(name, constructor) {
26    Ext.CommandDispatcher.types[name] = constructor;
27};
28
29load('src/Generator.js');
30load('src/generators/app/Application.js');
31load('src/generators/controller/Controller.js');
32load('src/generators/model/Model.js');
33
34var args   = system.arguments,
35    module = args[0];
36
37Ext.CommandDispatcher.dispatch(module, args.slice(1));