Skip to content

Commit

Permalink
Default ports to non-required, fixes #200
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Jun 25, 2014
1 parent ab719dc commit 28e6ba9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
@@ -1,6 +1,10 @@
NoFlo ChangeLog
===============

## 0.5.7 (git master)

* Ports now default to *not required*. Set the port option `required: true` the port needs to be connected in order for the component to work

## 0.5.6 (June 23rd 2014)

* Custom icon support for subgraphs via the `icon` key in graph properties
Expand Down
2 changes: 1 addition & 1 deletion component.json
Expand Up @@ -7,7 +7,7 @@
"flow"
],
"repo": "noflo/noflo",
"version": "0.5.5",
"version": "0.5.6",
"dependencies": {
"bergie/emitter": "*",
"jashkenas/underscore": "*",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
"flow"
],
"author": "Henri Bergius <henri.bergius@iki.fi>",
"version": "0.5.5",
"version": "0.5.6",
"licenses": [
{
"type": "MIT",
Expand Down
1 change: 1 addition & 0 deletions spec/Component.coffee
Expand Up @@ -92,6 +92,7 @@ describe 'Component', ->
outPorts:
error:
datatype: 'object'
required: true

s1 = new socket.InternalSocket
c.inPorts.in.attach s1
Expand Down
4 changes: 2 additions & 2 deletions spec/InPort.coffee
Expand Up @@ -15,8 +15,8 @@ describe 'Inport Port', ->
p = new inport
it 'should be of datatype "all"', ->
chai.expect(p.getDataType()).to.equal 'all'
it 'should be required', ->
chai.expect(p.isRequired()).to.equal true
it 'should not be required', ->
chai.expect(p.isRequired()).to.equal false
it 'should not be addressable', ->
chai.expect(p.isAddressable()).to.equal false
it 'should not be buffered', ->
Expand Down
2 changes: 1 addition & 1 deletion src/lib/BasePort.coffee
Expand Up @@ -30,7 +30,7 @@ class BasePort extends EventEmitter
handleOptions: (options) ->
options = {} unless options
options.datatype = 'all' unless options.datatype
options.required = true if options.required is undefined
options.required = false if options.required is undefined

options.datatype = 'int' if options.datatype is 'integer'
if validTypes.indexOf(options.datatype) is -1
Expand Down

0 comments on commit 28e6ba9

Please sign in to comment.