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
git clone [email protected]:mde/geddy.git | |
cd geddy | |
npm install | |
cd .. | |
./geddy/bin/cli.js app foo | |
cd foo | |
../geddy/bin/cli.js auth | |
../geddy/bin/cli.js |
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
mdes-mbp-2:bar mde$ ../geddy/bin/cli.js scaffold zooby | |
[Added] app/models/zooby.js | |
Creating table for Zooby | |
[Added] test/zooby.js | |
[Added] app/controllers/zoobies.js | |
[Added] Resource zoobies route added to config/router.js | |
jake aborted. | |
TypeError: ejs:10 | |
8| <div class="row list-item"> | |
(See full trace by running task with --trace) |
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
// Application controller | |
var Application = function () { | |
this.before(function () { | |
geddy.log.info('setting foo'); | |
this.foo = 'BAR'; | |
}); | |
}; |
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
var Zoobies = function () { | |
this.respondsWith = ['json', 'js', 'xml]; | |
this.create = function (req, resp, params) { | |
var self = this | |
, zooby = geddy.model.Zooby.create(params); | |
if (!zooby.isValid()) { | |
params.errors = zooby.errors; | |
// Figure out how you want to respond with an error |
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
upstream zerb_blarg { | |
server 127.0.0.1:4000; | |
} | |
server { | |
listen 80; | |
server_name www.zerb-blarg.org zerb-blarg.org; | |
access_log /var/log/nginx/zerb_blarg.access.log; | |
location / { | |
proxy_pass http://zerb_blarg; | |
} |
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
var Main = function () { | |
this.index = function (req, resp, params) { | |
this.respond(params, { | |
format: 'json' | |
}); | |
}; | |
this.test1 = function (req, resp, params) { | |
this.respond(params, { | |
format: 'json' |
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
templater.addListener('data', function (data) { | |
// Buffer for now, but we could stream | |
content += data; | |
}); | |
templater.addListener('end', function () { | |
if (self.params.action == 'test') { | |
if (content.indexOf('Hello') > -1) { | |
console.log(self.params.action); | |
throw new Error(); | |
} |
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
mdes-mbp-2:work mde$ geddy gen app foo | |
Created app foo. | |
mdes-mbp-2:work mde$ cd foo/ | |
mdes-mbp-2:foo mde$ geddy gen secret | |
Added app-secret to config/secrets.json. | |
DO NOT add this file into your revision control. | |
DO make a backup of it, keep it someplace safe. | |
mdes-mbp-2:foo mde$ geddy -v | |
0.9.8 |
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
♢ cli | |
when given a config file | |
✓ should load the specified config file | |
when calling execute more than once | |
✓ should not print the results from previous execution | |
♢ eslint | |
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
var User = function () { | |
this.hasMany('Messages'); | |
this.hasMany('ConversationMemberships'); | |
this.hasMany('Conversations', {through: 'ConversationMembership'}); | |
}; | |
var Conversation = function () { | |
this.hasMany('Messages'); | |
this.hasMany('ConversationMemberships'); | |
this.hasMany('Users', {through: 'ConversationMembership'}); |