philotic 0.0.1 → 0.1.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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -1
  3. data/Gemfile +0 -7
  4. data/README.md +2 -0
  5. data/Rakefile +1 -1
  6. data/examples/README.md +1 -1
  7. data/examples/creating_named_queues/manually.rb +8 -21
  8. data/examples/creating_named_queues/with_rake.rb +2 -2
  9. data/examples/publishing/publish.rb +26 -33
  10. data/examples/subscribing/acks.rb +25 -0
  11. data/examples/subscribing/anonymous_queue.rb +6 -10
  12. data/examples/subscribing/multiple_named_queues.rb +9 -24
  13. data/examples/subscribing/named_queue.rb +7 -17
  14. data/lib/philotic.rb +37 -81
  15. data/lib/philotic/config.rb +63 -24
  16. data/lib/philotic/connection.rb +35 -51
  17. data/lib/philotic/constants.rb +49 -0
  18. data/lib/philotic/event.rb +27 -14
  19. data/lib/philotic/logging.rb +8 -0
  20. data/lib/philotic/logging/event.rb +18 -0
  21. data/lib/philotic/logging/logger.rb +39 -0
  22. data/lib/philotic/publisher.rb +28 -31
  23. data/lib/philotic/routable.rb +40 -40
  24. data/lib/philotic/subscriber.rb +61 -42
  25. data/lib/philotic/tasks/init_queues.rb +4 -14
  26. data/lib/philotic/version.rb +1 -1
  27. data/philotic.gemspec +21 -10
  28. data/spec/philotic/config_spec.rb +40 -0
  29. data/spec/philotic/connection_spec.rb +58 -0
  30. data/spec/philotic/event_spec.rb +69 -0
  31. data/spec/philotic/logging/logger_spec.rb +26 -0
  32. data/spec/philotic/publisher_spec.rb +99 -0
  33. data/spec/{routable_spec.rb → philotic/routable_spec.rb} +15 -14
  34. data/spec/philotic/subscriber_spec.rb +111 -0
  35. data/spec/philotic_spec.rb +66 -0
  36. data/spec/spec_helper.rb +12 -4
  37. data/tasks/bump.rake +10 -10
  38. metadata +173 -36
  39. data/spec/connection_spec.rb +0 -19
  40. data/spec/event_spec.rb +0 -44
  41. data/spec/publisher_spec.rb +0 -102
  42. data/spec/subscriber_spec.rb +0 -72
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ module Philotic
4
+ module Logging
5
+ describe Logger do
6
+ let (:device) { double }
7
+ let(:logger) { Philotic::Logging::Logger.new(device) }
8
+ let (:message) { 'Hey!' }
9
+ specify do
10
+
11
+ expect(Philotic::Publisher).to receive(:publish) do |event|
12
+ expect(event.message).to eq message
13
+ expect(event.severity).to eq Logger::INFO
14
+
15
+ end
16
+ expect(device).to receive(:respond_to?).with(:write).and_return(true)
17
+ expect(device).to receive(:respond_to?).with(:close).and_return(true)
18
+ expect(device).to receive(:write) do |log_message|
19
+ expect(log_message).to match /#{message}/
20
+ end
21
+ logger.info message
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,99 @@
1
+ require 'spec_helper'
2
+ require 'philotic/dummy_event'
3
+
4
+ describe Philotic::Publisher do
5
+ before(:each) do
6
+ @event = Philotic::DummyEvent.new
7
+ @event.subject = 'Hello'
8
+ @event.message = 'How are you?'
9
+ @event.gender = :M
10
+ @event.available = true
11
+ end
12
+ let(:publisher) { Philotic::Publisher }
13
+ subject { publisher }
14
+
15
+ describe 'config' do
16
+ it 'should return the Philotic::Config singleton' do
17
+ expect(subject.config).to eq Philotic::Config
18
+ end
19
+ end
20
+
21
+
22
+ describe 'publish' do
23
+ it 'should call _publish with the right values' do
24
+ expect(subject).to receive(:_publish).with(
25
+ {
26
+ subject: 'Hello',
27
+ message: 'How are you?'
28
+ },
29
+ {
30
+ headers: {
31
+ philotic_firehose: true,
32
+ philotic_product: nil,
33
+ philotic_component: nil,
34
+ philotic_event_type: nil,
35
+ gender: :M,
36
+ available: true
37
+ },
38
+ timestamp: Time.now.to_i
39
+ }
40
+ )
41
+ subject.publish(@event)
42
+ end
43
+
44
+ end
45
+
46
+ describe 'raw_publish' do
47
+
48
+ it 'should call exchange.publish with the right values' do
49
+ exchange = double
50
+ expect(Philotic::Connection).to receive(:exchange).and_return(exchange)
51
+
52
+ expect(Philotic).to receive(:connect!)
53
+ expect(Philotic::Connection).to receive(:connected?).and_return(true)
54
+
55
+ expect(exchange).to receive(:publish).with(
56
+ {
57
+ subject: 'Hello',
58
+ message: 'How are you?'
59
+ }.to_json,
60
+ {
61
+ routing_key: nil,
62
+ persistent: true,
63
+ mandatory: true,
64
+ content_type: nil,
65
+ content_encoding: nil,
66
+ priority: nil,
67
+ message_id: nil,
68
+ correlation_id: nil,
69
+ reply_to: nil,
70
+ type: nil,
71
+ user_id: nil,
72
+ app_id: nil,
73
+ expiration: nil,
74
+ headers: {
75
+ philotic_firehose: true,
76
+ philotic_product: nil,
77
+ philotic_component: nil,
78
+ philotic_event_type: nil,
79
+ gender: :M,
80
+ available: true
81
+ },
82
+ timestamp: Time.now.to_i
83
+ }
84
+ )
85
+ subject.publish(@event)
86
+ end
87
+
88
+ it 'should log an error when there is no connection' do
89
+
90
+
91
+ expect(Philotic).to receive(:connect!)
92
+ expect(Philotic::Connection).to receive(:connected?).once.and_return(false)
93
+
94
+ expect(Philotic.logger).to receive(:error)
95
+ subject.publish(@event)
96
+ end
97
+
98
+ end
99
+ end
@@ -2,14 +2,14 @@ require 'spec_helper'
2
2
 
3
3
  describe Philotic::Routable do
4
4
  context "including the module on class" do
5
- let(:routable_event_class){
5
+ let(:routable_event_class) {
6
6
  Class.new do
7
7
  include Philotic::Routable
8
8
  attr_routable :routable_attr
9
9
  attr_payload :payload_attr
10
10
  end
11
11
  }
12
- subject { routable_event_class}
12
+ subject { routable_event_class }
13
13
 
14
14
  %w{ attr_payload_reader attr_payload_readers
15
15
  attr_payload_writer attr_payload_writers
@@ -18,40 +18,41 @@ describe Philotic::Routable do
18
18
  attr_routable_reader attr_routable_readers
19
19
  attr_routable_writers attr_routable_writer
20
20
  attr_routable }.each do |method_name|
21
- specify { subject.methods.should include method_name.to_sym }
21
+ specify { expect(subject.methods).to include method_name.to_sym }
22
22
  end
23
23
 
24
24
  context " and then instantiating it" do
25
- let(:routable_event_instance){ routable_event_class.new }
25
+ let(:routable_event_instance) { routable_event_class.new }
26
26
  subject { routable_event_instance }
27
27
 
28
28
  it 'should have proper headers' do
29
- subject.headers.should == { routable_attr: nil }
29
+ expect(subject.headers).to eq({routable_attr: nil})
30
30
  end
31
31
 
32
32
  it 'should have proper payload' do
33
- subject.payload.should == { payload_attr: nil }
33
+ expect(subject.payload).to eq({payload_attr: nil})
34
34
  end
35
35
 
36
36
  it 'should have proper attributes' do
37
- subject.attributes.should == { routable_attr: nil,
38
- payload_attr: nil }
37
+ expect(subject.attributes).to eq({routable_attr: nil, payload_attr: nil})
39
38
  end
40
39
 
41
40
  it 'should call Philotic::Publisher.publish with subject' do
42
- Philotic::Publisher.should_receive(:publish).with(subject)
41
+ expect(Philotic::Publisher).to receive(:publish).with(subject)
43
42
  subject.publish
44
- end
43
+ end
45
44
 
46
45
  it 'should have empty message_metadata' do
47
- subject.message_metadata.should == {}
46
+ expect(subject.message_metadata).to eq({})
48
47
  end
49
48
 
50
- context " overriding a value with message_metadata=" do
49
+ context "overriding a value with message_metadata=" do
51
50
  before do
52
- routable_event_instance.message_metadata = { mandatory: false }
51
+ routable_event_instance.message_metadata = {mandatory: false}
52
+ end
53
+ it 'should work' do
54
+ expect(subject.message_metadata).to eq(mandatory: false)
53
55
  end
54
- its(:message_metadata) { should eq( mandatory: false ) }
55
56
  end
56
57
  end
57
58
  end
@@ -0,0 +1,111 @@
1
+ require 'spec_helper'
2
+ require 'philotic/dummy_event'
3
+ require 'philotic/constants'
4
+
5
+ describe Philotic::Subscriber do
6
+
7
+
8
+ describe '.subscribe' do
9
+ let(:subscription) { 'some_queue' }
10
+ context 'when options is a string' do
11
+ it 'binds to a queue defined by the options' do
12
+
13
+ exchange = double
14
+ channel = double
15
+ queue = double
16
+
17
+ metadata = double
18
+ message = double
19
+
20
+ callback = lambda { |metadata, message|}
21
+
22
+ expect(Philotic).to receive(:connect!)
23
+
24
+ expect(Philotic::Connection).to receive(:exchange).and_return(exchange)
25
+ expect(Philotic::Connection).to receive(:channel).and_return(channel)
26
+ expect(channel).to receive(:queue).and_return(queue)
27
+
28
+ expect(queue).not_to receive(:bind)
29
+ expect(queue).to receive(:subscribe).with({})
30
+ expect(Philotic::Subscriber).to receive(:subscription_callback).and_yield(metadata, message)
31
+ expect(callback).to receive(:call).with(metadata, message)
32
+
33
+ Philotic::Subscriber.subscribe(subscription, &callback)
34
+ end
35
+ end
36
+
37
+ context 'when options is not a string' do
38
+ let(:subscription) do
39
+ {
40
+ firehose: true
41
+ }
42
+ end
43
+ it 'binds to a queue defined by the options' do
44
+
45
+ exchange = double
46
+ channel = double
47
+ queue = double
48
+
49
+ metadata = double
50
+ message = double
51
+
52
+ callback = lambda { |metadata, payload|}
53
+
54
+ expect(Philotic).to receive(:connect!)
55
+
56
+ expect(Philotic::Connection).to receive(:exchange).and_return(exchange)
57
+ expect(Philotic::Connection).to receive(:channel).and_return(channel)
58
+ expect(channel).to receive(:queue).and_return(queue)
59
+
60
+ expect(queue).to receive(:bind).with(exchange, hash_including(arguments: subscription))
61
+ expect(queue).to receive(:subscribe).with({})
62
+ expect(Philotic::Subscriber).to receive(:subscription_callback).and_yield(metadata, message)
63
+ expect(callback).to receive(:call).with(metadata, message)
64
+
65
+ Philotic::Subscriber.subscribe(subscription, &callback)
66
+ end
67
+ end
68
+ end
69
+
70
+ describe '.subscribe_to_any' do
71
+ let(:headers) do
72
+ {
73
+ header1: 'h1',
74
+ header2: 'h2',
75
+ header3: 'h3',
76
+ }
77
+ end
78
+ specify do
79
+ expect(Philotic::Subscriber).to receive(:subscribe).with(headers.merge(:'x-match' => :any))
80
+ Philotic::Subscriber.subscribe_to_any(headers) {}
81
+ end
82
+ end
83
+
84
+ describe '.acknowledge' do
85
+ let(:channel) { double }
86
+ let(:delivery_tag) { double }
87
+ let(:delivery_info) { double }
88
+ let(:message) { {delivery_info: delivery_info} }
89
+
90
+ specify do
91
+ expect(Philotic::Connection).to receive(:channel).and_return(channel)
92
+ expect(delivery_info).to receive(:delivery_tag).and_return(delivery_tag)
93
+ expect(channel).to receive(:acknowledge).with(delivery_tag, false)
94
+ Philotic::Subscriber.acknowledge(message)
95
+ end
96
+ end
97
+
98
+ describe '.reject' do
99
+ let(:channel) { double }
100
+ let(:delivery_tag) { double }
101
+ let(:delivery_info) { double }
102
+ let(:message) { {delivery_info: delivery_info} }
103
+
104
+ specify do
105
+ expect(Philotic::Connection).to receive(:channel).and_return(channel)
106
+ expect(delivery_info).to receive(:delivery_tag).and_return(delivery_tag)
107
+ expect(channel).to receive(:reject).with(delivery_tag, true)
108
+ Philotic::Subscriber.reject(message)
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,66 @@
1
+ require 'spec_helper'
2
+
3
+ describe Philotic do
4
+
5
+ describe '.initialize_named_queue!' do
6
+
7
+ let(:test_queues) do
8
+ {
9
+ app_live_feed: {
10
+ exchange: 'philotic.headers.test_app.feed.live',
11
+ options: {
12
+ arguments: {
13
+ :'x-dead-letter-exchange' => 'philotic.headers.test_app.feed.delayed',
14
+ :'x-message-ttl' => 600000 # ms
15
+ }},
16
+ bindings:
17
+ [
18
+ {
19
+ philotic_product: 'test_app',
20
+ philotic_component: 'app_component',
21
+ :'x-match:' => 'all'
22
+ },
23
+ ],
24
+ }
25
+ }
26
+ end
27
+ it "should throw an error when ENV['INITIALIZE_NAMED_QUEUE'] is not set to 'true'" do
28
+ ENV['INITIALIZE_NAMED_QUEUE'] = nil
29
+ queue_name = test_queues.keys.first
30
+ config = test_queues[queue_name]
31
+ expect(Philotic).to receive(:connect!)
32
+ expect { Philotic.initialize_named_queue! queue_name, config }.to raise_error("ENV['INITIALIZE_NAMED_QUEUE'] must equal 'true' to run Philotic.initialize_named_queue!")
33
+
34
+ end
35
+
36
+ it 'should set up the queue with the right parameters' do
37
+ ENV['INITIALIZE_NAMED_QUEUE'] = 'true'
38
+
39
+ test_queues.each_pair do |queue_name, config|
40
+
41
+ queue_options = Philotic::DEFAULT_NAMED_QUEUE_OPTIONS.dup
42
+ queue_options.merge!(config[:options] || {})
43
+
44
+ channel = double
45
+ queue = double
46
+ exchange = double
47
+ connection = double
48
+
49
+ expect(Philotic).to receive(:connect!)
50
+ expect(Philotic::Connection).to receive(:connection).and_return(connection)
51
+ expect(connection).to receive(:queue_exists?)
52
+ expect(Philotic::Connection).to receive(:channel).and_return(channel).exactly(2).times
53
+ expect(channel).to receive(:queue).with(queue_name, queue_options).and_return(queue)
54
+ expect(channel).to receive(:headers).with(config[:exchange], durable: true) { exchange }
55
+ expect(queue).to receive(:name).and_return(queue_name).exactly(2).times
56
+
57
+ config[:bindings].each do |arguments|
58
+ expect(queue).to receive(:bind).with(exchange, {arguments: arguments})
59
+ Philotic.initialize_named_queue! queue_name, config
60
+ end
61
+
62
+
63
+ end
64
+ end
65
+ end
66
+ end
data/spec/spec_helper.rb CHANGED
@@ -3,10 +3,18 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'support'))
4
4
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'config'))
5
5
 
6
-
7
- require 'rubygems'
6
+ require 'simplecov'
7
+ require 'codeclimate-test-reporter'
8
+ SimpleCov.start do
9
+ formatter SimpleCov::Formatter::MultiFormatter[
10
+ SimpleCov::Formatter::HTMLFormatter,
11
+ CodeClimate::TestReporter::Formatter
12
+ ]
13
+ end
8
14
  require 'bundler/setup'
15
+ require 'rspec/its'
9
16
  require 'philotic'
17
+ require 'timecop'
10
18
 
11
19
  Bundler.require(:default, :test)
12
20
 
@@ -18,6 +26,6 @@ RSpec.configure do |config|
18
26
  config.after do
19
27
  Timecop.return
20
28
  end
21
-
29
+
22
30
  end
23
- #Philotic.logger = Logger.new("/dev/null")
31
+ Philotic.logger = Logger.new("/dev/null")
data/tasks/bump.rake CHANGED
@@ -4,10 +4,10 @@ task bump: 'bump:patch'
4
4
  namespace :bump do
5
5
  desc 'Bump x.y.Z'
6
6
  task :patch
7
-
7
+
8
8
  desc 'Bump x.Y.z'
9
9
  task :minor
10
-
10
+
11
11
  desc 'Bump X.y.z'
12
12
  task :major
13
13
  end
@@ -15,16 +15,16 @@ end
15
15
  # extracted and modified from https://github.com/grosser/project_template
16
16
  rule /^bump:.*/ do |t|
17
17
  sh "git status | grep 'nothing to commit'" # ensure we are not dirty
18
- index = ['major', 'minor','patch'].index(t.name.split(':').last)
19
- file = 'lib/philotic/version.rb'
18
+ index = ['major', 'minor', 'patch'].index(t.name.split(':').last)
19
+ file = 'lib/philotic/version.rb'
20
20
 
21
- version_file = File.read(file)
21
+ version_file = File.read(file)
22
22
  old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
23
- version_parts[index] = version_parts[index].to_i + 1
24
- version_parts[2] = 0 if index < 2
25
- version_parts[1] = 0 if index < 1
26
- new_version = version_parts * '.'
27
- File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
23
+ version_parts[index] = version_parts[index].to_i + 1
24
+ version_parts[2] = 0 if index < 2
25
+ version_parts[1] = 0 if index < 1
26
+ new_version = version_parts * '.'
27
+ File.open(file, 'w') { |f| f.write(version_file.sub(old_version, new_version)) }
28
28
 
29
29
  sh "bundle && git add #{file} && git commit -m 'bump version to #{new_version}'"
30
30
  end
metadata CHANGED
@@ -1,83 +1,209 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: philotic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Keyes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: codeclimate-test-reporter
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: evented-spec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.9'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.9'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0.10'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '0.10'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '10.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '10.3'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '3.1'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '3.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec-its
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '1.1'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '1.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: timecop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '0.7'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '0.7'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
13
139
  - !ruby/object:Gem::Dependency
14
140
  name: activesupport
15
141
  requirement: !ruby/object:Gem::Requirement
16
142
  requirements:
17
- - - "~>"
143
+ - - '>='
18
144
  - !ruby/object:Gem::Version
19
- version: '4.0'
145
+ version: '3.2'
20
146
  type: :runtime
21
147
  prerelease: false
22
148
  version_requirements: !ruby/object:Gem::Requirement
23
149
  requirements:
24
- - - "~>"
150
+ - - '>='
25
151
  - !ruby/object:Gem::Version
26
- version: '4.0'
152
+ version: '3.2'
27
153
  - !ruby/object:Gem::Dependency
28
154
  name: activerecord
29
155
  requirement: !ruby/object:Gem::Requirement
30
156
  requirements:
31
- - - "~>"
157
+ - - '>='
32
158
  - !ruby/object:Gem::Version
33
- version: '4.0'
159
+ version: '3.2'
34
160
  type: :runtime
35
161
  prerelease: false
36
162
  version_requirements: !ruby/object:Gem::Requirement
37
163
  requirements:
38
- - - "~>"
164
+ - - '>='
39
165
  - !ruby/object:Gem::Version
40
- version: '4.0'
166
+ version: '3.2'
41
167
  - !ruby/object:Gem::Dependency
42
- name: amqp
168
+ name: awesome_print
43
169
  requirement: !ruby/object:Gem::Requirement
44
170
  requirements:
45
- - - "~>"
171
+ - - ~>
46
172
  - !ruby/object:Gem::Version
47
173
  version: '1.2'
48
174
  type: :runtime
49
175
  prerelease: false
50
176
  version_requirements: !ruby/object:Gem::Requirement
51
177
  requirements:
52
- - - "~>"
178
+ - - ~>
53
179
  - !ruby/object:Gem::Version
54
180
  version: '1.2'
55
181
  - !ruby/object:Gem::Dependency
56
- name: awesome_print
182
+ name: bunny
57
183
  requirement: !ruby/object:Gem::Requirement
58
184
  requirements:
59
- - - "~>"
185
+ - - ~>
60
186
  - !ruby/object:Gem::Version
61
- version: '1.2'
187
+ version: 1.2.1
62
188
  type: :runtime
63
189
  prerelease: false
64
190
  version_requirements: !ruby/object:Gem::Requirement
65
191
  requirements:
66
- - - "~>"
192
+ - - ~>
67
193
  - !ruby/object:Gem::Version
68
- version: '1.2'
194
+ version: 1.2.1
69
195
  - !ruby/object:Gem::Dependency
70
196
  name: json
71
197
  requirement: !ruby/object:Gem::Requirement
72
198
  requirements:
73
- - - "~>"
199
+ - - ~>
74
200
  - !ruby/object:Gem::Version
75
201
  version: '1.8'
76
202
  type: :runtime
77
203
  prerelease: false
78
204
  version_requirements: !ruby/object:Gem::Requirement
79
205
  requirements:
80
- - - "~>"
206
+ - - ~>
81
207
  - !ruby/object:Gem::Version
82
208
  version: '1.8'
83
209
  description: Lightweight, opinionated wrapper for using RabbitMQ headers exchanges
@@ -87,9 +213,9 @@ executables: []
87
213
  extensions: []
88
214
  extra_rdoc_files: []
89
215
  files:
90
- - ".gitignore"
91
- - ".rspec"
92
- - ".travis.yml"
216
+ - .gitignore
217
+ - .rspec
218
+ - .travis.yml
93
219
  - Gemfile
94
220
  - LICENSE
95
221
  - README.md
@@ -99,14 +225,19 @@ files:
99
225
  - examples/creating_named_queues/philotic_named_queues.yml
100
226
  - examples/creating_named_queues/with_rake.rb
101
227
  - examples/publishing/publish.rb
228
+ - examples/subscribing/acks.rb
102
229
  - examples/subscribing/anonymous_queue.rb
103
230
  - examples/subscribing/multiple_named_queues.rb
104
231
  - examples/subscribing/named_queue.rb
105
232
  - lib/philotic.rb
106
233
  - lib/philotic/config.rb
107
234
  - lib/philotic/connection.rb
235
+ - lib/philotic/constants.rb
108
236
  - lib/philotic/dummy_event.rb
109
237
  - lib/philotic/event.rb
238
+ - lib/philotic/logging.rb
239
+ - lib/philotic/logging/event.rb
240
+ - lib/philotic/logging/logger.rb
110
241
  - lib/philotic/publisher.rb
111
242
  - lib/philotic/routable.rb
112
243
  - lib/philotic/subscriber.rb
@@ -116,12 +247,15 @@ files:
116
247
  - philotic.gemspec
117
248
  - philotic.yml.example
118
249
  - philotic_queues.yml.example
119
- - spec/connection_spec.rb
120
- - spec/event_spec.rb
121
- - spec/publisher_spec.rb
122
- - spec/routable_spec.rb
250
+ - spec/philotic/config_spec.rb
251
+ - spec/philotic/connection_spec.rb
252
+ - spec/philotic/event_spec.rb
253
+ - spec/philotic/logging/logger_spec.rb
254
+ - spec/philotic/publisher_spec.rb
255
+ - spec/philotic/routable_spec.rb
256
+ - spec/philotic/subscriber_spec.rb
257
+ - spec/philotic_spec.rb
123
258
  - spec/spec_helper.rb
124
- - spec/subscriber_spec.rb
125
259
  - tasks/bump.rake
126
260
  homepage: https://github.com/nkeyes/philotic
127
261
  licenses:
@@ -133,25 +267,28 @@ require_paths:
133
267
  - lib
134
268
  required_ruby_version: !ruby/object:Gem::Requirement
135
269
  requirements:
136
- - - ">="
270
+ - - '>='
137
271
  - !ruby/object:Gem::Version
138
272
  version: '0'
139
273
  required_rubygems_version: !ruby/object:Gem::Requirement
140
274
  requirements:
141
- - - ">="
275
+ - - '>='
142
276
  - !ruby/object:Gem::Version
143
277
  version: '0'
144
278
  requirements: []
145
279
  rubyforge_project:
146
- rubygems_version: 2.2.1
280
+ rubygems_version: 2.2.2
147
281
  signing_key:
148
282
  specification_version: 4
149
283
  summary: Lightweight, opinionated wrapper for using RabbitMQ headers exchanges
150
284
  test_files:
151
- - spec/connection_spec.rb
152
- - spec/event_spec.rb
153
- - spec/publisher_spec.rb
154
- - spec/routable_spec.rb
285
+ - spec/philotic/config_spec.rb
286
+ - spec/philotic/connection_spec.rb
287
+ - spec/philotic/event_spec.rb
288
+ - spec/philotic/logging/logger_spec.rb
289
+ - spec/philotic/publisher_spec.rb
290
+ - spec/philotic/routable_spec.rb
291
+ - spec/philotic/subscriber_spec.rb
292
+ - spec/philotic_spec.rb
155
293
  - spec/spec_helper.rb
156
- - spec/subscriber_spec.rb
157
294
  has_rdoc: