Skip to content

Commit

Permalink
Merge pull request #4 from muhammadnawzad/main
Browse files Browse the repository at this point in the history
Updates dependencies' versions
  • Loading branch information
broosk1993 authored Dec 14, 2023
2 parents 3bb19c1 + 7c4c7ea commit ff838c5
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 41 deletions.
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in rabbit_carrots.gemspec
gemspec

gem 'rake', '~> 13.0'
gem 'rake', '~> 13.1'

gem 'rspec', '~> 3.0'
gem 'rspec', '~> 3.12'

gem 'rubocop', '~> 1.21'
gem 'rubocop', '~> 1.58'

gem 'rubocop-rails', '~> 2.17'
gem 'rubocop-rails', '~> 2.22'
74 changes: 45 additions & 29 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
PATH
remote: .
specs:
rabbit_carrots (0.1.19)
bunny (>= 2.19.0)
connection_pool (~> 2.3.0)
rabbit_carrots (0.1.20)
bunny (>= 2.22)
connection_pool (~> 2.4)

GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.4)
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
amq-protocol (2.3.2)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.4)
bunny (2.22.0)
amq-protocol (~> 2.3, >= 2.3.1)
sorted_set (~> 1, >= 1.0.2)
concurrent-ruby (1.1.10)
connection_pool (2.3.0)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
diff-lcs (1.5.0)
i18n (1.12.0)
drb (2.2.0)
ruby2_keywords
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.2)
minitest (5.16.3)
parallel (1.22.1)
parser (3.1.2.1)
json (2.7.1)
language_server-protocol (3.17.0.3)
minitest (5.20.0)
mutex_m (0.2.0)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
rack (3.0.4.2)
racc
racc (1.7.3)
rack (3.0.8)
rainbow (3.1.1)
rake (13.0.6)
rake (13.1.0)
rbtree (0.4.6)
regexp_parser (2.6.1)
rexml (3.2.5)
regexp_parser (2.8.3)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -47,40 +60,43 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (1.39.0)
rubocop (1.58.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.2.1)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.23.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.23.0)
parser (>= 3.1.1.0)
rubocop-rails (2.17.3)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-rails (2.22.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
ruby-progressbar (1.11.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
set (1.0.3)
sorted_set (1.0.3)
rbtree
set (~> 1.0)
tzinfo (2.0.5)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.3.0)
unicode-display_width (2.5.0)

PLATFORMS
x86_64-linux

DEPENDENCIES
rabbit_carrots!
rake (~> 13.0)
rspec (~> 3.0)
rubocop (~> 1.21)
rubocop-rails (~> 2.17)
rake (~> 13.1)
rspec (~> 3.12)
rubocop (~> 1.58)
rubocop-rails (~> 2.22)

BUNDLED WITH
2.3.26
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RabbitCarrots.configure do |c|
c.rabbitmq_user = ENV.fetch('RABBITMQ__USER', nil)
c.rabbitmq_password = ENV.fetch('RABBITMQ__PASSWORD', nil)
c.rabbitmq_vhost = ENV.fetch('RABBITMQ__VHOST', nil)
c.event_bus_exchange_name = ENV.fetch('EVENTBUS__EXCHANGE_NAME', nil)
c.rabbitmq_exchange_name = ENV.fetch('RABBITMQ__EXCHANGE_NAME', nil)
c.routing_key_mappings = [
{ routing_keys: ['RK1', 'RK2'], queue: 'QUEUE_NAME', handler: 'CLASS HANDLER IN STRING' },
{ routing_keys: ['RK1', 'RK2'], queue: 'QUEUE_NAME', handler: 'CLASS HANDLER IN STRING' }
Expand Down
2 changes: 1 addition & 1 deletion lib/rabbit_carrots/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ def self.configure
end

class Configuration
attr_accessor :rabbitmq_host, :rabbitmq_port, :rabbitmq_user, :rabbitmq_password, :rabbitmq_vhost, :routing_key_mappings, :event_bus_exchange_name
attr_accessor :rabbitmq_host, :rabbitmq_port, :rabbitmq_user, :rabbitmq_password, :rabbitmq_vhost, :routing_key_mappings, :rabbitmq_exchange_name
end
end
8 changes: 5 additions & 3 deletions lib/rabbit_carrots/tasks/rmq.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ namespace :rabbit_carrots do
task eat: :environment do
Rails.application.eager_load!

# rubocop:disable Lint/ConstantDefinitionInBlock
DatabaseAgonsticNotNullViolation = defined?(ActiveRecord) ? ActiveRecord::NotNullViolation : RabbitCarrots::EventHandlers::Errors::PlaceholderError
DatabaseAgonsticConnectionNotEstablished = defined?(ActiveRecord) ? ActiveRecord::ConnectionNotEstablished : Mongo::Error::SocketError
DatabaseAgnosticRecordInvalid = defined?(ActiveRecord) ? ActiveRecord::RecordInvalid : Mongoid::Errors::Validations

# rubocop:enable Lint/ConstantDefinitionInBlock

channels = RabbitCarrots.configuration.routing_key_mappings.map do |mapping|
# This will be supplied in initializer. At that time, the Handler will not be available to be loaded and will throw Uninitialized Constant
{ **mapping, handler: mapping[:handler].constantize }
Expand All @@ -32,9 +34,9 @@ namespace :rabbit_carrots do
end
end

def run_task(queue_name:, queue_arguments: {}, handler_class:, routing_keys:)
def run_task(queue_name:, handler_class:, routing_keys:, queue_arguments: {})
RabbitCarrots::Connection.instance.channel.with do |channel|
exchange = channel.topic(RabbitCarrots.configuration.event_bus_exchange_name, durable: true)
exchange = channel.topic(RabbitCarrots.configuration.rabbitmq_exchange_name, durable: true)

Rails.logger.info "Listening on QUEUE: #{queue_name} for ROUTING KEYS: #{routing_keys}"
queue = channel.queue(queue_name, durable: true, arguments: queue_arguments)
Expand Down
2 changes: 1 addition & 1 deletion lib/rabbit_carrots/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RabbitCarrots
VERSION = '0.1.19'
VERSION = '0.1.20'
end
4 changes: 2 additions & 2 deletions rabbit_carrots.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

# Uncomment to register a new dependency of your gem
spec.add_dependency 'bunny', '>= 2.19.0'
spec.add_dependency 'connection_pool', '~> 2.3.0'
spec.add_dependency 'bunny', '>= 2.22'
spec.add_dependency 'connection_pool', '~> 2.4'

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
Expand Down

0 comments on commit ff838c5

Please sign in to comment.