17 lines
279 B
Ruby
17 lines
279 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
require 'bunny'
|
|
|
|
connection = Bunny.new
|
|
connection.start
|
|
|
|
channel = connection.create_channel
|
|
exchange = channel.fanout('logs')
|
|
|
|
message = ARGV.empty? ? 'Hello World!' : ARGV.join(' ')
|
|
|
|
exchange.publish(message)
|
|
puts " [x] Sent #{message}"
|
|
|
|
connection.close
|