forked from geddy/geddy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into serverportfailure
- Loading branch information
Showing
185 changed files
with
24,752 additions
and
212 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ node_modules | |
tmtags | ||
*.DS_Store | ||
examples/*/log/* | ||
site/log/* | ||
.log | ||
npm-debug.log | ||
doc/ |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### 0.5.0 | ||
+ removed models from geddy core | ||
+ removed utilities from geddy core | ||
+ removed router from geddy core | ||
+ added [model](https://github.com/mde/model) as a dependency | ||
+ added [utilities](https://github.com/mde/utilities) as a dependency | ||
+ added [barista](https://github.com/kieran/barista) as a dependency | ||
+ added the `geddy console` command | ||
+ added the `geddy exec` command | ||
+ added a ton of tests | ||
+ a ton of minor bug fixes | ||
+ created a new website |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
Geddy is built on the same MVC principles that many popular frameworks are based on. Every Geddy app has it's models, controllers, and views as well as config files and routes. | ||
|
||
* * * | ||
|
||
#### structure | ||
|
||
``` | ||
├── app | ||
│ ├── controllers | ||
│ │ ├── application.js | ||
│ │ └── main.js | ||
│ ├── helpers | ||
│ ├── models | ||
│ └── views | ||
│ ├── layouts | ||
│ │ └── application.html.jade | ||
│ └── main | ||
│ └── index.html.jade | ||
├── config | ||
├── development.js | ||
├── environment.js | ||
├── init.js | ||
├── production.js | ||
└── router.js | ||
├── lib | ||
├── log | ||
├── node_modules | ||
└── public | ||
``` | ||
|
||
* * * | ||
|
||
#### config | ||
`geddy.config` | ||
|
||
Geddy has built in configuration management. Global config options should go in your ‘config/environments.js` file. Likewise, your production and development config options should go in their respective files | ||
|
||
If you want to start up your app in a specific environment, use the `-e` option: | ||
|
||
``` | ||
$ geddy -e production | ||
``` | ||
|
||
* * * | ||
|
||
#### logger | ||
`geddy.log[level]` | ||
|
||
Geddy automatically logs requests to an access log, and you can log anything you'd like to stdout or a file. It supports 9 different log levels from debug to emergency. | ||
|
||
##### levels | ||
- `access`: outputs to the access log and stdout | ||
- `debug`: debug level logging | ||
- `info`: info level logging | ||
- `notice`: notice level logging | ||
- `warning`: warning level logging | ||
- `error`: error level logging, prints to stdout and stderr | ||
- `critical`: critical level logging | ||
- `alert`: alert level logging | ||
- `emergency`: emergency level logging | ||
|
||
##### examples | ||
``` | ||
geddy.log.debug(‘someting to debug`) | ||
// prints `something to debug` to the console | ||
geddy.log.error(‘something went wrong’) | ||
// prints ‘something went wrong’ to stderr and the console | ||
``` | ||
|
||
* * * |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
Geddy uses [Barista](http://github.com/kieran/barista) as it's router. Its API is very similar to rails routes. Both general purpose resource based routes and individually defined routes are possible. | ||
|
||
* * * | ||
|
||
#### .match | ||
`router.match( path [, method] )` | ||
|
||
defines the url to match to a controller action. | ||
|
||
##### path | ||
- `path [string]`: the url to match to an action | ||
|
||
##### method | ||
- `method [string]`: the http method to match | ||
|
||
##### examples | ||
``` | ||
router.match(‘/‘).to(‘Main.index’); | ||
// will route any request to ‘/‘ to the Main controller’s index action | ||
router.match( '/products/:id', 'GET' ).to( 'products.show' ) | ||
// will route ‘/products/5’ to Products.show() | ||
// and set the id paramer to be 5 | ||
router.match( '/profiles/:username', 'GET' ).to( 'users.show' ) | ||
// will route ‘/products/dan’ to Users.show() | ||
// and set the username paramer to be dan | ||
router.match( '/products/:id(.:format)', 'GET' ).to( 'products.show' ) | ||
// things enclosed in parentheses are optional | ||
``` | ||
|
||
* * * | ||
|
||
#### .to | ||
`router.match( path ).to( action )` | ||
|
||
defines the action to map the path to. | ||
|
||
##### action | ||
- `action [string]`: a controller name plus an action name as a string | ||
- `action [object]`: an object that defines a controller and action property | ||
|
||
##### examples | ||
``` | ||
router.match(‘/‘).to(‘Main.index’); | ||
// will route any request to ‘/‘ to the Main controller’s index action | ||
router.match(‘/‘).to({controller: ‘Main’, action: ‘index’}); | ||
// will route any request to ‘/‘ to the Main controller’s index action | ||
``` | ||
|
||
* * * | ||
|
||
#### .get | ||
`router.get( path )` | ||
|
||
Equivalent to `router.match( path, 'GET' )` | ||
|
||
* * * | ||
|
||
#### .post | ||
`router.post( path )` | ||
|
||
Equivalent to `router.match( path, ‘POST’ )` | ||
|
||
* * * | ||
|
||
#### .put | ||
`router.put( path )` | ||
|
||
Equivalent to `router.match( path, ‘PUT’ )` | ||
|
||
* * * | ||
|
||
#### .del | ||
`router.del( path )` | ||
|
||
Equivalent to `router.match( path, ‘DELETE’ )` | ||
|
||
* * * | ||
|
||
#### .resource | ||
`router.resource( controller )` | ||
|
||
generates standard resource routes for a controller name | ||
|
||
##### controller | ||
- `controller [string]`: the camelCased controller name that needs resourceful routes | ||
|
||
##### examples | ||
``` | ||
router.resource( 'products' ) | ||
// is equivalent to: | ||
router.get( '/products(.:format)' ).to( 'products.index' ) | ||
router.get( '/products/add(.:format)' ).to( 'products.add' ) | ||
router.get( '/products/:id(.:format)' ).to('products.show' ) | ||
router.get('/products/:id/edit(.:format)' ).to( 'products.edit' ) | ||
router.post('/products(.:format)' ).to( 'products.create' ) | ||
router.put('/products/:id(.:format)' ).to( 'products.update' ) | ||
router.del('/products/:id(.:format)' ).to( 'products.destroy' ) | ||
``` | ||
|
||
* * * |
Oops, something went wrong.