Skip to content

Commit

Permalink
allow connection string argument for Bunny.run
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed May 5, 2012
1 parent 00384af commit 3d809dd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/bunny.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ def self.new(connection_string_or_opts = Hash.new, opts = Hash.new)
setup(connection_string_or_opts, opts)
end

# Runs a code block using a short-lived connection

def self.run(opts = {}, &block)
# Runs a code block using a Bunny connection
def self.run(connection_string_or_opts = {}, opts = {}, &block)
raise ArgumentError, 'Bunny#run requires a block' unless block

# Set up Bunny
client = setup(opts)
client = setup(connection_string_or_opts, opts)

begin
client.start
Expand Down

0 comments on commit 3d809dd

Please sign in to comment.