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: d37328fbc7b4544b7211d5faa01c24074a91b90b
4
- data.tar.gz: a10fa60d75b70e75501ba206345ae2078cb0c69f
3
+ metadata.gz: 6898065da7e5fbbbd2f444441347498d0675832a
4
+ data.tar.gz: dccb7c7b76d0794bb1d38f36d135f51b1c86e148
5
5
  SHA512:
6
- metadata.gz: a63d94605ffc727da9a8462c82daff47401a9cd4f4a6dbf1feb9d3a5adcec441936218ba53af150c39298cc108ce8349938d8c01a014cfe97be341cbf3ab4479
7
- data.tar.gz: 50b3d3dd019aebf3279fdad42ecdd638c735add1caa7f6a326d36d2a6fcdb7da1fb0ca1dea39faf8eb273fa750e7c7ecf871562e717fcd98af076d6fbee1fd64
6
+ metadata.gz: 7f861f74a9170206ea1de002990059b8a10edd60df99d573360bf84073be44c734cf2553fcbc7de128f6cd8b667bfce74f31d2896eeab70ecf90c16f04fc767d
7
+ data.tar.gz: 0eb4d070dc7c3ccfe54d88dc104f851c49f3f528bc043d0787939dd65d782f1edf96a05d5263d2e9655850115a26b6e5bcdc8314f5a35f0b56cc26ea6c01e015
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- artsy-eventservice (0.1.1)
4
+ artsy-eventservice (0.1.2)
5
5
  bunny (~> 2.6.2)
6
6
 
7
7
  GEM
@@ -2,8 +2,8 @@ require 'bunny'
2
2
 
3
3
  module Artsy
4
4
  module EventService
5
- def self.conn
6
- @conn ||= Bunny.new(
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)
@@ -1,6 +1,6 @@
1
1
  module Artsy
2
2
  module EventService
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
6
6
 
@@ -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(:conn).at_least(3).times.and_return(conn)
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.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-23 00:00:00.000000000 Z
11
+ date: 2017-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny