cony 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.travis.yml CHANGED
@@ -9,3 +9,6 @@ gemfile:
9
9
  - gemfiles/activesupport-4.0.gemfile
10
10
  - gemfiles/activesupport-4.1.gemfile
11
11
  - gemfiles/activesupport-4.2.gemfile
12
+
13
+ before_install:
14
+ - gem install bundler
data/Gemfile.lock CHANGED
@@ -1,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cony (1.4.0)
4
+ cony (1.5.0)
5
5
  activesupport (>= 3)
6
- bunny (~> 1.1.7)
6
+ bunny (~> 1.7.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (4.1.6)
12
- i18n (~> 0.6, >= 0.6.9)
11
+ activesupport (4.2.5)
12
+ i18n (~> 0.7)
13
13
  json (~> 1.7, >= 1.7.7)
14
14
  minitest (~> 5.1)
15
- thread_safe (~> 0.1)
15
+ thread_safe (~> 0.3, >= 0.3.4)
16
16
  tzinfo (~> 1.1)
17
17
  amq-protocol (1.9.2)
18
- bunny (1.1.9)
19
- amq-protocol (>= 1.9.2)
18
+ bunny (1.7.1)
19
+ amq-protocol (~> 1.9.2)
20
20
  diff-lcs (1.2.5)
21
- i18n (0.6.11)
22
- json (1.8.1)
23
- minitest (5.4.2)
21
+ i18n (0.7.0)
22
+ json (1.8.3)
23
+ minitest (5.8.3)
24
24
  rake (10.3.0)
25
25
  rspec (2.14.1)
26
26
  rspec-core (~> 2.14.0)
@@ -30,7 +30,7 @@ GEM
30
30
  rspec-expectations (2.14.5)
31
31
  diff-lcs (>= 1.1.3, < 2.0)
32
32
  rspec-mocks (2.14.6)
33
- thread_safe (0.3.4)
33
+ thread_safe (0.3.5)
34
34
  tzinfo (1.2.2)
35
35
  thread_safe (~> 0.1)
36
36
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.1
1
+ 1.5.0
data/cony.gemspec CHANGED
@@ -5,8 +5,8 @@ $:.push File.expand_path('../lib', __FILE__)
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'cony'
7
7
  s.version = File.read(File.expand_path('../VERSION', __FILE__)).strip
8
- s.authors = ['Raffael Schmid']
9
- s.email = ['info@nine.ch']
8
+ s.authors = ['nine.ch Development-Team']
9
+ s.email = ['development@nine.ch']
10
10
  s.homepage = 'http://github.com/ninech/'
11
11
  s.license = 'MIT'
12
12
  s.summary = 'Automatically sends notifications via AMQP when a model has been changed.'
@@ -21,5 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'rspec', '~> 2.12'
22
22
 
23
23
  s.add_runtime_dependency 'activesupport', '>= 3'
24
- s.add_runtime_dependency 'bunny', '~> 1.1.7'
24
+ s.add_runtime_dependency 'bunny', '~> 1.7.0'
25
25
  end
@@ -10,7 +10,8 @@ module Cony
10
10
 
11
11
  def publish(message, routing_key)
12
12
  Bunny.run(@config) do |connection|
13
- exchange = connection.exchange(@config[:exchange], type: :topic, durable: Cony.config.durable)
13
+ channel = connection.create_channel
14
+ exchange = channel.topic(@config[:exchange], durable: Cony.config.durable)
14
15
  exchange.publish(message.to_json,
15
16
  key: routing_key,
16
17
  mandatory: false,
@@ -14,9 +14,14 @@ describe Cony::AMQPConnectionHandler do
14
14
  exc.stub(:publish)
15
15
  end
16
16
  end
17
+ let(:channel_double) do
18
+ double('Channel double').tap do |channel|
19
+ channel.stub(:topic).and_return(exchange_double)
20
+ end
21
+ end
17
22
  let(:connection_double) do
18
23
  double('Connection double').tap do |conn|
19
- conn.stub(:exchange).and_return(exchange_double)
24
+ conn.stub(:create_channel).and_return(channel_double)
20
25
  end
21
26
  end
22
27
 
@@ -32,7 +37,7 @@ describe Cony::AMQPConnectionHandler do
32
37
  end
33
38
 
34
39
  it 'configures the exchange correctly' do
35
- connection_double.should_receive(:exchange).with('bunny-tests', type: :topic, durable: false)
40
+ channel_double.should_receive(:topic).with('bunny-tests', durable: false)
36
41
  subject.publish(message, routing_key)
37
42
  end
38
43
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cony
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Raffael Schmid
8
+ - nine.ch Development-Team
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-20 00:00:00.000000000 Z
12
+ date: 2016-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 1.1.7
69
+ version: 1.7.0
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,10 +74,10 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 1.1.7
77
+ version: 1.7.0
78
78
  description: Automatically sends notifications via AMQP when a model has been changed.
79
79
  email:
80
- - info@nine.ch
80
+ - development@nine.ch
81
81
  executables:
82
82
  - cony-receive
83
83
  extensions: []