Merge pull request #4 from muhammadnawzad/main

Updates dependencies' versions
This commit is contained in:
Brusk Awat 2023-12-14 11:00:44 +03:00 committed by GitHub
commit ff838c50ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 41 deletions

View File

@ -5,10 +5,10 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in rabbit_carrots.gemspec # Specify your gem's dependencies in rabbit_carrots.gemspec
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'

View File

@ -1,39 +1,52 @@
PATH PATH
remote: . remote: .
specs: specs:
rabbit_carrots (0.1.19) rabbit_carrots (0.1.20)
bunny (>= 2.19.0) bunny (>= 2.22)
connection_pool (~> 2.3.0) connection_pool (~> 2.4)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activesupport (7.0.4) activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
minitest (>= 5.1) minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0) tzinfo (~> 2.0)
amq-protocol (2.3.2) amq-protocol (2.3.2)
ast (2.4.2) ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.4)
bunny (2.22.0) bunny (2.22.0)
amq-protocol (~> 2.3, >= 2.3.1) amq-protocol (~> 2.3, >= 2.3.1)
sorted_set (~> 1, >= 1.0.2) sorted_set (~> 1, >= 1.0.2)
concurrent-ruby (1.1.10) concurrent-ruby (1.2.2)
connection_pool (2.3.0) connection_pool (2.4.1)
diff-lcs (1.5.0) diff-lcs (1.5.0)
i18n (1.12.0) drb (2.2.0)
ruby2_keywords
i18n (1.14.1)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
json (2.6.2) json (2.7.1)
minitest (5.16.3) language_server-protocol (3.17.0.3)
parallel (1.22.1) minitest (5.20.0)
parser (3.1.2.1) mutex_m (0.2.0)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1) ast (~> 2.4.1)
rack (3.0.4.2) racc
racc (1.7.3)
rack (3.0.8)
rainbow (3.1.1) rainbow (3.1.1)
rake (13.0.6) rake (13.1.0)
rbtree (0.4.6) rbtree (0.4.6)
regexp_parser (2.6.1) regexp_parser (2.8.3)
rexml (3.2.5) rexml (3.2.6)
rspec (3.12.0) rspec (3.12.0)
rspec-core (~> 3.12.0) rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0) rspec-expectations (~> 3.12.0)
@ -47,40 +60,43 @@ GEM
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0) rspec-support (~> 3.12.0)
rspec-support (3.12.0) rspec-support (3.12.0)
rubocop (1.39.0) rubocop (1.58.0)
json (~> 2.3) json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.1.2.1) parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0) regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.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) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0) unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.23.0) rubocop-ast (1.30.0)
parser (>= 3.1.1.0) parser (>= 3.2.1.0)
rubocop-rails (2.17.3) rubocop-rails (2.22.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0) 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) set (1.0.3)
sorted_set (1.0.3) sorted_set (1.0.3)
rbtree rbtree
set (~> 1.0) set (~> 1.0)
tzinfo (2.0.5) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (2.3.0) unicode-display_width (2.5.0)
PLATFORMS PLATFORMS
x86_64-linux x86_64-linux
DEPENDENCIES DEPENDENCIES
rabbit_carrots! rabbit_carrots!
rake (~> 13.0) rake (~> 13.1)
rspec (~> 3.0) rspec (~> 3.12)
rubocop (~> 1.21) rubocop (~> 1.58)
rubocop-rails (~> 2.17) rubocop-rails (~> 2.22)
BUNDLED WITH BUNDLED WITH
2.3.26 2.3.26

View File

@ -32,7 +32,7 @@ RabbitCarrots.configure do |c|
c.rabbitmq_user = ENV.fetch('RABBITMQ__USER', nil) c.rabbitmq_user = ENV.fetch('RABBITMQ__USER', nil)
c.rabbitmq_password = ENV.fetch('RABBITMQ__PASSWORD', nil) c.rabbitmq_password = ENV.fetch('RABBITMQ__PASSWORD', nil)
c.rabbitmq_vhost = ENV.fetch('RABBITMQ__VHOST', 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 = [ 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' },
{ routing_keys: ['RK1', 'RK2'], queue: 'QUEUE_NAME', handler: 'CLASS HANDLER IN STRING' } { routing_keys: ['RK1', 'RK2'], queue: 'QUEUE_NAME', handler: 'CLASS HANDLER IN STRING' }

View File

@ -9,6 +9,6 @@ module RabbitCarrots
end end
class Configuration 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
end end

View File

@ -5,9 +5,11 @@ namespace :rabbit_carrots do
task eat: :environment do task eat: :environment do
Rails.application.eager_load! Rails.application.eager_load!
# rubocop:disable Lint/ConstantDefinitionInBlock
DatabaseAgonsticNotNullViolation = defined?(ActiveRecord) ? ActiveRecord::NotNullViolation : RabbitCarrots::EventHandlers::Errors::PlaceholderError DatabaseAgonsticNotNullViolation = defined?(ActiveRecord) ? ActiveRecord::NotNullViolation : RabbitCarrots::EventHandlers::Errors::PlaceholderError
DatabaseAgonsticConnectionNotEstablished = defined?(ActiveRecord) ? ActiveRecord::ConnectionNotEstablished : Mongo::Error::SocketError DatabaseAgonsticConnectionNotEstablished = defined?(ActiveRecord) ? ActiveRecord::ConnectionNotEstablished : Mongo::Error::SocketError
DatabaseAgnosticRecordInvalid = defined?(ActiveRecord) ? ActiveRecord::RecordInvalid : Mongoid::Errors::Validations DatabaseAgnosticRecordInvalid = defined?(ActiveRecord) ? ActiveRecord::RecordInvalid : Mongoid::Errors::Validations
# rubocop:enable Lint/ConstantDefinitionInBlock
channels = RabbitCarrots.configuration.routing_key_mappings.map do |mapping| 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 # This will be supplied in initializer. At that time, the Handler will not be available to be loaded and will throw Uninitialized Constant
@ -32,9 +34,9 @@ namespace :rabbit_carrots do
end end
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| 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}" Rails.logger.info "Listening on QUEUE: #{queue_name} for ROUTING KEYS: #{routing_keys}"
queue = channel.queue(queue_name, durable: true, arguments: queue_arguments) queue = channel.queue(queue_name, durable: true, arguments: queue_arguments)

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module RabbitCarrots module RabbitCarrots
VERSION = '0.1.19' VERSION = '0.1.20'
end end

View File

@ -32,8 +32,8 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib'] spec.require_paths = ['lib']
# Uncomment to register a new dependency of your gem # Uncomment to register a new dependency of your gem
spec.add_dependency 'bunny', '>= 2.19.0' spec.add_dependency 'bunny', '>= 2.22'
spec.add_dependency 'connection_pool', '~> 2.3.0' spec.add_dependency 'connection_pool', '~> 2.4'
# For more information and examples about making a new gem, check out our # For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html # guide at: https://bundler.io/guides/creating_gem.html