noflo/noflo — pull request #267 by trustmaster (2014-10-17 13:35:00+00:00)
Title: Make `Ports.add()` method chainable

Returning a collection on `add` / `remove` allows a shorter syntax
best illustrated by examples below:

```coffeescript
c.inPorts.add 'param1',
datatype: 'string'
required: true
c.inPorts.add 'param2',
datatype: 'int'
required: false
c.inPorts.add 'param3',
datatype: 'int'
required: true
default: 0
c.inPorts.add 'data1',
datatype: 'string'
c.inPorts.add 'data2',
datatype: 'int'
c.outPorts.add 'out',
datatype: 'object'
c.outPorts.add 'error',
datatype: 'object'

c.inPorts.add 'param1',
datatype: 'string'
required: true
.add 'param2',
datatype: 'int'
required: false
.add 'param3',
datatype: 'int'
required: true
default: 0
.add 'data1',
datatype: 'string'
.add 'data2',
datatype: 'int'
c.outPorts.add 'out',
datatype: 'object'
.add 'error',
datatype: 'object'
```

```coffeescript
c.inPorts.add 'in', datatype: 'string'
c.inPorts.add 'message', datatype: 'string'
c.inPorts.add 'repository', datatype: 'string'
c.inPorts.add 'path', datatype: 'string'
c.inPorts.add 'token', datatype: 'string', (event, payload) ->
c.token = payload if event is 'data'

c.inPorts.add 'in', datatype: 'string'
.add 'message', datatype: 'string'
.add 'repository', datatype: 'string'
.add 'path', datatype: 'string'
.add 'token', datatype: 'string', (event, payload) ->
c.token = payload if event is 'data'
```