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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d932c690cc671eb2b994cf0bbb301acd957ad49
4
- data.tar.gz: 91fafff2cbff86ba6f4dc36b453f88e8a51b2ecc
3
+ metadata.gz: da22f2cff535f26012ea1e29172e911edcfeac00
4
+ data.tar.gz: 229caebf288c3ae773309116b23924bb9bf7bcae
5
5
  SHA512:
6
- metadata.gz: 1d203b836d552f4aae1d4f9dbb2c6de26412d6735eea4506d62c1e3f35d024d0b92ea34364397d58850403e82cf65ababca3a257ca800373fe83d5b099269859
7
- data.tar.gz: e31efb1c0441591e0f5e1da60827db8cb0c2de24821898bd78faf04f83ba5c715b36e57eee05ed130f0ebbcfc571e1659ef898989fb9f9355de850842691f3e9
6
+ metadata.gz: cd846101dc8ec827f7ef317d1ed35a2e08e323a0660e7fe3ee112819d29415c93d37c3869368b00a0b4ad070eb2f396814acbadaaef9cece1e2ac228ed9844a6
7
+ data.tar.gz: eb52c3d0558736c43bfbfb2bffa377ca7aadb8777867c496e973c07205674d9a296b8f93f75bc3f55557f922b097fc0792217d1ac4e92dc998b77be0e78f7718
@@ -77,3 +77,7 @@ Style/MultilineBlockChain:
77
77
  Style/SymbolProc:
78
78
  Exclude:
79
79
  - 'spec/lib/rabbit_feed/event_routing_spec.rb'
80
+
81
+ Style/FileName:
82
+ Exclude:
83
+ - 'Brewfile'
@@ -1,5 +1,5 @@
1
1
  class BeaversController < ApplicationController
2
- before_action :set_beaver, only: [:show, :edit, :update, :destroy]
2
+ before_action :set_beaver, only: %i[show edit update destroy]
3
3
 
4
4
  # GET /beavers
5
5
  # GET /beavers.json
@@ -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(#{config.root}/lib)
23
+ config.eager_load_paths += %W[#{config.root}/lib]
24
24
  end
25
25
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+
2
3
  # This file is auto-generated from the current state of the database. Instead
3
4
  # of editing this file, please use the migrations feature of Active Record to
4
5
  # incrementally modify your database, and then regenerate this schema definition.
@@ -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(consume produce shutdown console), message: '%{value} is not a valid command' }
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.load(ERB.new(File.read(file_path)).result)
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
@@ -1,3 +1,3 @@
1
1
  module RabbitFeed
2
- VERSION = '3.0.2'.freeze
2
+ VERSION = '3.0.3'.freeze
3
3
  end
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'rabbit_feed/version'
@@ -159,7 +159,7 @@ module RabbitFeed
159
159
  let(:options) do
160
160
  {
161
161
  host: 'host_name',
162
- hosts: %w(host_name0 host_name1),
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(host_name0 host_name1) }
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(price policy_id)) }
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 publish_event(event_name, event_payload).asserting { |actual_payload| expect(actual_payload).to eq(event_payload) }
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 publish_event(event_name, event_payload).asserting { |actual_payload| expect(actual_payload).not_to eq(event_payload) }
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 publish_event(event_name).asserting { |actual_payload| expect(actual_payload).to eq(event_payload) }
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 publish_event(event_name).asserting { |actual_payload| expect(actual_payload).not_to eq('field' => 'different value') }
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
@@ -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 = [:should, :expect]
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.2
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-01-04 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny