artsy-eventservice 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6898065da7e5fbbbd2f444441347498d0675832a
|
4
|
+
data.tar.gz: dccb7c7b76d0794bb1d38f36d135f51b1c86e148
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f861f74a9170206ea1de002990059b8a10edd60df99d573360bf84073be44c734cf2553fcbc7de128f6cd8b667bfce74f31d2896eeab70ecf90c16f04fc767d
|
7
|
+
data.tar.gz: 0eb4d070dc7c3ccfe54d88dc104f851c49f3f528bc043d0787939dd65d782f1edf96a05d5263d2e9655850115a26b6e5bcdc8314f5a35f0b56cc26ea6c01e015
|
data/Gemfile.lock
CHANGED
@@ -2,8 +2,8 @@ require 'bunny'
|
|
2
2
|
|
3
3
|
module Artsy
|
4
4
|
module EventService
|
5
|
-
def self.
|
6
|
-
|
5
|
+
def self.create_conn
|
6
|
+
Bunny.new(
|
7
7
|
ENV['RABBITMQ_URL'],
|
8
8
|
tls: true,
|
9
9
|
tls_cert: Base64.decode64(ENV['RABBITMQ_CLIENT_CERT'] || ''),
|
@@ -16,6 +16,7 @@ module Artsy
|
|
16
16
|
def self.post_event(topic:, event:)
|
17
17
|
return unless ENV['EVENT_STREAM_ENABLED']
|
18
18
|
raise 'Event missing topic or verb.' if event.verb.to_s.empty? || topic.to_s.empty?
|
19
|
+
conn = create_conn
|
19
20
|
conn.start
|
20
21
|
channel = conn.create_channel
|
21
22
|
exchange = channel.topic(topic, durable: true)
|
@@ -38,7 +38,7 @@ describe Artsy::EventService do
|
|
38
38
|
end
|
39
39
|
it 'calls publish on the exchange with proper data' do
|
40
40
|
conn = double
|
41
|
-
expect(Artsy::EventService).to receive(:
|
41
|
+
expect(Artsy::EventService).to receive(:create_conn).once.and_return(conn)
|
42
42
|
expect(conn).to receive(:start).once
|
43
43
|
expect(conn).to receive(:close).once
|
44
44
|
channel = double
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artsy-eventservice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashkan Nasseri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01
|
11
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|