rabbit_feed 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/example/rails_app/app/controllers/beavers_controller.rb +1 -1
- data/example/rails_app/config/application.rb +1 -1
- data/example/rails_app/db/schema.rb +1 -0
- data/lib/rabbit_feed/client.rb +1 -1
- data/lib/rabbit_feed/configuration.rb +1 -1
- data/lib/rabbit_feed/consumer_connection.rb +1 -1
- data/lib/rabbit_feed/version.rb +1 -1
- data/rabbit_feed.gemspec +1 -0
- data/spec/lib/rabbit_feed/configuration_spec.rb +2 -2
- data/spec/lib/rabbit_feed/event_definitions_spec.rb +1 -1
- data/spec/lib/rabbit_feed/event_routing_spec.rb +4 -4
- data/spec/lib/rabbit_feed/testing_support/rspec_matchers/publish_event_spec.rb +4 -4
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da22f2cff535f26012ea1e29172e911edcfeac00
|
4
|
+
data.tar.gz: 229caebf288c3ae773309116b23924bb9bf7bcae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd846101dc8ec827f7ef317d1ed35a2e08e323a0660e7fe3ee112819d29415c93d37c3869368b00a0b4ad070eb2f396814acbadaaef9cece1e2ac228ed9844a6
|
7
|
+
data.tar.gz: eb52c3d0558736c43bfbfb2bffa377ca7aadb8777867c496e973c07205674d9a296b8f93f75bc3f55557f922b097fc0792217d1ac4e92dc998b77be0e78f7718
|
data/.rubocop.yml
CHANGED
@@ -20,6 +20,6 @@ module RailsApp
|
|
20
20
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
21
21
|
# config.i18n.default_locale = :de
|
22
22
|
|
23
|
-
config.eager_load_paths += %W
|
23
|
+
config.eager_load_paths += %W[#{config.root}/lib]
|
24
24
|
end
|
25
25
|
end
|
data/lib/rabbit_feed/client.rb
CHANGED
@@ -16,7 +16,7 @@ module RabbitFeed
|
|
16
16
|
|
17
17
|
attr_reader :command, :options
|
18
18
|
validates_presence_of :command, :options
|
19
|
-
validates :command, inclusion: { in: %w
|
19
|
+
validates :command, inclusion: { in: %w[consume produce shutdown console], message: '%{value} is not a valid command' }
|
20
20
|
validate :log_file_path_exists
|
21
21
|
validate :config_file_exists
|
22
22
|
validate :require_path_valid, unless: :console?
|
@@ -66,7 +66,7 @@ module RabbitFeed
|
|
66
66
|
private
|
67
67
|
|
68
68
|
def self.read_configuration_file(file_path, environment)
|
69
|
-
raw_configuration = YAML.
|
69
|
+
raw_configuration = YAML.safe_load(ERB.new(File.read(file_path)).result)
|
70
70
|
HashWithIndifferentAccess.new(raw_configuration[environment] || {})
|
71
71
|
end
|
72
72
|
private_class_method :read_configuration_file
|
@@ -6,7 +6,7 @@ module RabbitFeed
|
|
6
6
|
block: false, # Don't block the thread whilst consuming from the queue, as this breaks during connection recovery
|
7
7
|
}.freeze
|
8
8
|
|
9
|
-
SEVEN_DAYS_IN_MS = 7.days * 1000
|
9
|
+
SEVEN_DAYS_IN_MS = 7.days.to_i * 1000
|
10
10
|
|
11
11
|
QUEUE_OPTIONS = {
|
12
12
|
durable: true, # Persist across server restart
|
data/lib/rabbit_feed/version.rb
CHANGED
data/rabbit_feed.gemspec
CHANGED
@@ -159,7 +159,7 @@ module RabbitFeed
|
|
159
159
|
let(:options) do
|
160
160
|
{
|
161
161
|
host: 'host_name',
|
162
|
-
hosts: %w
|
162
|
+
hosts: %w[host_name0 host_name1],
|
163
163
|
port: 12_345,
|
164
164
|
user: 'user_name',
|
165
165
|
password: 'password',
|
@@ -176,7 +176,7 @@ module RabbitFeed
|
|
176
176
|
end
|
177
177
|
|
178
178
|
its(:host) { should eq 'host_name' }
|
179
|
-
its(:hosts) { should eq %w
|
179
|
+
its(:hosts) { should eq %w[host_name0 host_name1] }
|
180
180
|
its(:port) { should eq 12_345 }
|
181
181
|
its(:user) { should eq 'user_name' }
|
182
182
|
its(:password) { should eq 'password' }
|
@@ -19,7 +19,7 @@ module RabbitFeed
|
|
19
19
|
it { should_not be_nil }
|
20
20
|
it { should be_valid }
|
21
21
|
its(:name) { should eq 'customer_purchases_policy' }
|
22
|
-
its(:sensitive_fields) { should match_array(%w
|
22
|
+
its(:sensitive_fields) { should match_array(%w[price policy_id]) }
|
23
23
|
|
24
24
|
describe EventDefinitions::Event do
|
25
25
|
let(:name) { 'event_name' }
|
@@ -22,14 +22,14 @@ module RabbitFeed
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'should create routing keys for the specified routes' do
|
25
|
-
RabbitFeed::Consumer.event_routing.accepted_routes.should =~ %w
|
25
|
+
RabbitFeed::Consumer.event_routing.accepted_routes.should =~ %w[
|
26
26
|
test.dummy_1.event_1
|
27
27
|
test.dummy_1.event_2
|
28
28
|
test.dummy_2.event_3
|
29
29
|
test.*.event_3
|
30
30
|
test.*.event_4
|
31
31
|
test.dummy_3.*
|
32
|
-
|
32
|
+
]
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'routes the event to the correct action, preferring named applications' do
|
@@ -114,7 +114,7 @@ module RabbitFeed
|
|
114
114
|
end
|
115
115
|
|
116
116
|
it 'applies routing definitions in a cumulative manner' do
|
117
|
-
RabbitFeed::Consumer.event_routing.accepted_routes.should =~ %w
|
117
|
+
RabbitFeed::Consumer.event_routing.accepted_routes.should =~ %w[
|
118
118
|
test.dummy_1.event_1
|
119
119
|
test.dummy_1.event_2
|
120
120
|
test.dummy_2.event_3
|
@@ -122,7 +122,7 @@ module RabbitFeed
|
|
122
122
|
test.*.event_3
|
123
123
|
test.*.event_4
|
124
124
|
test.dummy_3.*
|
125
|
-
|
125
|
+
]
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
@@ -115,22 +115,22 @@ module RabbitFeed
|
|
115
115
|
it 'prefers the earlier payload' do
|
116
116
|
expect do
|
117
117
|
RabbitFeed::Producer.publish_event(event_name, 'field' => 'different value')
|
118
|
-
end.not_to
|
118
|
+
end.not_to(publish_event(event_name, event_payload).asserting { |actual_payload| expect(actual_payload).to eq(event_payload) })
|
119
119
|
|
120
120
|
expect do
|
121
121
|
RabbitFeed::Producer.publish_event(event_name, 'field' => 'different value')
|
122
|
-
end.not_to
|
122
|
+
end.not_to(publish_event(event_name, event_payload).asserting { |actual_payload| expect(actual_payload).not_to eq(event_payload) })
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
126
|
it 'performs the assertion' do
|
127
127
|
expect do
|
128
128
|
RabbitFeed::Producer.publish_event(event_name, event_payload)
|
129
|
-
end.to
|
129
|
+
end.to(publish_event(event_name).asserting { |actual_payload| expect(actual_payload).to eq(event_payload) })
|
130
130
|
|
131
131
|
expect do
|
132
132
|
RabbitFeed::Producer.publish_event(event_name, event_payload)
|
133
|
-
end.to
|
133
|
+
end.to(publish_event(event_name).asserting { |actual_payload| expect(actual_payload).not_to eq('field' => 'different value') })
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -17,7 +17,7 @@ Dir.glob('spec/features/step_definitions/**/*_steps.rb') { |f| load f, true }
|
|
17
17
|
|
18
18
|
RSpec.configure do |config|
|
19
19
|
config.expect_with :rspec do |expects|
|
20
|
-
expects.syntax = [
|
20
|
+
expects.syntax = %i[should expect]
|
21
21
|
end
|
22
22
|
|
23
23
|
config.before do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_feed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simply Business
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|