-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from gengojs/1.0.0-alpha.2
1.0.0-alpha.2
- Loading branch information
Showing
21 changed files
with
638 additions
and
288 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { | ||
version | ||
} | ||
from '../../package'; | ||
import core from 'gengojs-core'; | ||
import pack from 'gengojs-default-pack'; | ||
export default (function() { | ||
'use strict'; | ||
/** | ||
* Global scope | ||
* @private | ||
*/ | ||
var global; | ||
/** | ||
* @method gengo | ||
* @description Main function for Gengo. | ||
* @param {Object} options The configuration options. | ||
* @return {Function} The middleware for express. | ||
* @public | ||
*/ | ||
var gengo = function(options, plugins) { | ||
global = core(options, plugins || pack()); | ||
return global.ship.bind(global); | ||
}; | ||
/** | ||
* @method clone | ||
* @description Returns the API. | ||
* @return {Function} The API. | ||
* @public | ||
*/ | ||
gengo.clone = function() { | ||
return global.assign.apply(global, arguments); | ||
}; | ||
/** | ||
* version. | ||
* @type {String} | ||
* @public | ||
*/ | ||
gengo.version = version; | ||
// Export | ||
return gengo; | ||
})(); |
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,55 @@ | ||
import { | ||
version, name | ||
} | ||
from '../../package'; | ||
import core from 'gengojs-core'; | ||
import pack from 'gengojs-default-pack'; | ||
export default (function() { | ||
'use strict'; | ||
/** | ||
* Global scope | ||
* @private | ||
*/ | ||
var global; | ||
|
||
function hapi(plugin, options, next) { | ||
plugin.ext('onPreHandler', function(request, reply) { | ||
global.ship.bind(global)(request); | ||
reply.continue(); | ||
}); | ||
plugin.ext('onPreResponse', function(request, reply) { | ||
global.ship.bind(global)(request); | ||
reply.continue(); | ||
}); | ||
next(); | ||
} | ||
|
||
var gengo = function(options, plugins) { | ||
global = core(options, plugins || pack()); | ||
var register = hapi; | ||
register.attributes = { | ||
name | ||
}; | ||
return { | ||
register: register, | ||
options: options || {} | ||
}; | ||
}; | ||
/** | ||
* @method clone | ||
* @description Returns the API. | ||
* @return {Function} The API. | ||
* @public | ||
*/ | ||
gengo.clone = function() { | ||
return global.assign.apply(global, arguments); | ||
}; | ||
/** | ||
* version. | ||
* @type {String} | ||
* @public | ||
*/ | ||
gengo.version = version; | ||
// Export | ||
return gengo; | ||
})(); |
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,47 @@ | ||
import { | ||
version | ||
} | ||
from '../../package'; | ||
import core from 'gengojs-core'; | ||
import pack from 'gengojs-default-pack'; | ||
import 'babel/polyfill'; | ||
export default (function() { | ||
'use strict'; | ||
/** | ||
* Global scope | ||
* @private | ||
*/ | ||
var global; | ||
/** | ||
* @method gengo | ||
* @description Main function for Gengo. | ||
* @param {Object} options The configuration options. | ||
* @return {Function} The middleware for express. | ||
* @public | ||
*/ | ||
var gengo = function gengo(options, plugins) { | ||
global = core(options, plugins || pack()); | ||
return function*(next) { | ||
global.ship.bind(global)(this); | ||
yield next; | ||
}; | ||
}; | ||
/** | ||
* @method clone | ||
* @description Returns the API. | ||
* @return {Function} The API. | ||
* @public | ||
*/ | ||
gengo.clone = function() { | ||
return global.assign.apply(global, arguments); | ||
}; | ||
|
||
/** | ||
* version | ||
* @type {String} | ||
* @public | ||
*/ | ||
gengo.version = version; | ||
// Export | ||
return gengo; | ||
})(); |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
node_modules/ | ||
*.sublime-workspace | ||
*.sublime-project | ||
test/npm-debug.log | ||
test/npm-debug.log | ||
jsconfig.json | ||
lib/ | ||
.backup/ | ||
.publish/ |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- 4.1 | ||
- 0.12 | ||
- 0.11 | ||
- 0.10 | ||
- iojs | ||
|
||
before_install: npm install -g grunt-cli | ||
before_install: npm install -g gulp |
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,41 @@ | ||
{ | ||
"beautify":{ | ||
"indent_size": 2, | ||
"indent_char": " ", | ||
"eol": "\n", | ||
"indent_level": 0, | ||
"indent_with_tabs": false, | ||
"preserve_newlines": true, | ||
"max_preserve_newlines": 10, | ||
"jslint_happy": false, | ||
"space_after_anon_function": false, | ||
"brace_style": "collapse", | ||
"keep_array_indentation": false, | ||
"keep_function_indentation": false, | ||
"space_before_conditional": true, | ||
"break_chained_methods": false, | ||
"eval_code": false, | ||
"unescape_strings": false, | ||
"wrap_line_length": 0, | ||
"wrap_attributes": "auto", | ||
"wrap_attributes_indent_size": 4, | ||
"end_with_newline": false | ||
}, | ||
"jshint":{ | ||
"browser": false, | ||
"jquery": false, | ||
"node": true, | ||
"esnext": true, | ||
"camelcase": true, | ||
"eqeqeq": true, | ||
"indent": 2, | ||
"latedef": true, | ||
"maxlen": 120, | ||
"newcap": true, | ||
"quotmark": "single", | ||
"strict": true, | ||
"undef": true, | ||
"unused": true, | ||
"eqnull": true | ||
} | ||
} |
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
Oops, something went wrong.