Skip to content

Commit

Permalink
Merge branch 'release/1.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
FGRibreau committed Feb 9, 2013
2 parents 887ab05 + f853fbd commit 47aaa66
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -101,8 +101,9 @@ See `examples/` and `docs/` for more information.
* `.bind( name, routingKey )`

### .connect
* `.connect( amqp, callback(err, amqp) )`
* `.connect()`
* `.connect( callback(err, amqp) )`
* `.connect( amqp, callback(err, amqp) )`

The `amqp` argument is simply hashtable with the following properties:

Expand All @@ -123,6 +124,7 @@ The `amqp` argument is simply hashtable with the following properties:
$ npm test

## Release History
v1.0.3 - Support for .connect()
v1.0.2 - Critical bug fix
v1.0.1 - .bind & .subscribe can now be called multiple times. This is the behavior that should have been in place since the beginning.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -5,12 +5,12 @@
"amqp",
"dsl"
],
"version": "1.0.3",
"version": "1.0.4",
"homepage": "https://github.com/FGRibreau/node-amqp-dsl",
"repository": "",
"dependencies": {
"async": "0.1.x",
"amqp": "~0.1.4",
"amqp": "0.1.3",
"docco": "0.3.x",
"coffee-script": "~1.4.0"
},
Expand Down
4 changes: 4 additions & 0 deletions src/AmqpDsl.coffee
Expand Up @@ -109,6 +109,10 @@ module.exports = class AmqpDsl
#
connect:(amqp, @_callback)->

if amqp is undefined
@_callback = ->
amqp = require 'amqp'

if typeof amqp is "function"
@_callback = amqp
amqp = require 'amqp'
Expand Down
7 changes: 7 additions & 0 deletions test/AmqpDsl-test.coffee
Expand Up @@ -167,6 +167,13 @@ suite.addBatch
"connect":
topic: -> AmqpDsl.login()

"Accept ()": (cc)->

cc._connect = (amqp) ->
assert.equal amqp, require('amqp')

cc.connect()

"Accept ( callback )": (cc)->

cc._connect = (amqp) ->
Expand Down

0 comments on commit 47aaa66

Please sign in to comment.