On Github heinzelmannchen / ba-presentation
Christoph Hermann & Sebastian Sprenger
doSomething(function(error) { if (error) { //... } else { doSomethingElse(function(error) { if (error) { //... } else { doSomethingElse2(function(error) { if (error) { //... } else { //... } }); } }); } });
function doSomething() { ... } .then(doSomethingElse) .then(doSomethingElse2) .fail(onFail);
GitHub
class <%= className %> { <% _.each(attributes, function(attribute) { %> public <%= attribute.type %> <%= attribute.name %>; <% }) %> }
{ "className": "Person", "attributes": [{ "name": "name", "type": "string" }, { "name": "age", "type": "int" }] }
class Person { public string name; public int age; }
{ "domains": { }, "generators": { }, "templates": { }, "customScript": "./templates/customScripts/index.js" }
"domains": { "data": { "version": "1.0.1" }, "generator": { }, "extjs": { "model": { } }, "backend": { "entity": { "template": "./templates/backend/Entity.php.tpl", "output": "./webroot/backend/Entity/<%= modelName %>.php" }, "controller": { } } }, }
$ heinzel [?] What would you like me to do today? (Use arrow keys) ❯ create domains initialize the .heinzelrc list domains, templates and generators explain datastructure returned by generator install templates and generators uninstall templates and generators update templates and generators search templates and generators in the npm registry
$ heinzel create backend.entity --override
function doSomethingAsPromise() { var q = Q.defer(), result; ... q.resolve(result); return q.promise; } doSomethingAsPromise().then(function calledWhenResolved(result) { console.log(result); });
describe('Template', function() { describe('#process', function() { it('should process the template', function() { var template = '<%= heinzel %>', data = { heinzel: 'Berti' }; return heinzelTemplate.process(template, data).should.become('Berti'); }); }); });