irfsdash 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/irfsdash.rb +5 -2
- data/lib/irfsdash/version.rb +1 -1
- metadata +1 -1
data/lib/irfsdash.rb
CHANGED
@@ -4,7 +4,10 @@ require "json"
|
|
4
4
|
module IRFSDash
|
5
5
|
# Returns an AMQP channel
|
6
6
|
def self.amqp
|
7
|
-
@b
|
7
|
+
return @b if @b
|
8
|
+
@b = Bunny.new(host: 'localhost')
|
9
|
+
@b.start
|
10
|
+
return @b
|
8
11
|
end
|
9
12
|
# Setup the library's defaults
|
10
13
|
def self.setup(opts={})
|
@@ -25,7 +28,7 @@ module IRFSDash
|
|
25
28
|
msg = opts.merge!(@defaults)
|
26
29
|
raise ArgumentError, "No source specified" unless msg[:source]
|
27
30
|
raise ArgumentError, "No project specified" unless msg[:project]
|
28
|
-
raise ArgumentError, "No happy specified" unless msg
|
31
|
+
raise ArgumentError, "No happy specified" unless msg.keys.include? :happy
|
29
32
|
self.amqp.exchange("irfs-dashboard.projects", type: :fanout).publish(JSON.dump(msg))
|
30
33
|
end
|
31
34
|
# Publish to the ticker
|
data/lib/irfsdash/version.rb
CHANGED