Skip to content

Commit

Permalink
docs: added code climate badge
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Dec 28, 2014
1 parent 1e0fc58 commit c932177
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Array as a Service (AaaS)
[![Travis](https://img.shields.io/travis/christophwitzko/array-as-a-service.svg?style=flat)](https://travis-ci.org/christophwitzko/array-as-a-service) [![Coveralls](https://img.shields.io/coveralls/christophwitzko/array-as-a-service.svg?style=flat)](https://coveralls.io/r/christophwitzko/array-as-a-service)
[![Travis](https://img.shields.io/travis/christophwitzko/array-as-a-service.svg?style=flat)](https://travis-ci.org/christophwitzko/array-as-a-service) [![Coveralls](https://img.shields.io/coveralls/christophwitzko/array-as-a-service.svg?style=flat)](https://coveralls.io/r/christophwitzko/array-as-a-service) [![Code Climate](https://img.shields.io/codeclimate/github/christophwitzko/array-as-a-service.svg?style=flat)](https://codeclimate.com/github/christophwitzko/array-as-a-service)

## Run AaaS

Expand Down
9 changes: 5 additions & 4 deletions routes/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function handleData(key){
}

function storeOp(store, cmd, get, he, logTpl, aidx, key){
logTpl = aidx ? (logTpl || '<cmd> at %d from id: %s') : logTpl
logTpl = (logTpl || '<cmd>ing <get> id: %s').replace(/<cmd>/gm, cmd).replace(/<get>/gm, get ? 'from' : 'to')
var handleFn = he ? handleError : handleData(key || 'data')
return function(req, res){
Expand Down Expand Up @@ -73,10 +74,10 @@ module.exports = function(store){
shift: storeOp(store, 'shift', true, false),
push: storeOp(store, 'push', false, true),
unshift: storeOp(store, 'unshift', false, true),
set: storeOp(store, 'set', false, true, '<cmd>ting at %d from id: %s', true),
get: storeOp(store, 'get', true, false, '<cmd>ting at %d from id: %s', true),
remove: storeOp(store, 'remove', true, false, 'removeing at %d from id: %s', true),
indexOf: storeOp(store, 'indexOf', false, false, 'indexof at %d from id: %s', true, 'index'),
set: storeOp(store, 'set', false, true, null, true),
get: storeOp(store, 'get', true, false, null, true),
remove: storeOp(store, 'remove', true, false, null, true),
indexOf: storeOp(store, 'indexOf', false, false, null, true, 'index'),
slice: function(req, res){
debug('slicing at (%s - %s) from id: %s', req.params.begin, req.params.end, req.params.id)
store.slice(req.params.id, req.params.begin, req.params.end, handleData('data').bind(null, res))
Expand Down

0 comments on commit c932177

Please sign in to comment.