19 lines
255 B
Ruby
19 lines
255 B
Ruby
#!/usr/bin/env ruby
|
|
# encoding: utf-8
|
|
|
|
require "bunny"
|
|
|
|
conn = Bunny.new
|
|
conn.start
|
|
|
|
ch = conn.create_channel
|
|
x = ch.fanout("logs")
|
|
|
|
msg = ARGV.empty? ? "Hello World!" : ARGV.join(" ")
|
|
|
|
x.publish(msg)
|
|
puts " [x] Sent '#{msg}'"
|
|
|
|
sleep 0.5
|
|
conn.close
|