harmoniser 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: e388156d56ef5ed0664269fd342a778cf7cd96547539d8282125252a880b2fe8
4
- data.tar.gz: 0d1a7a75f214c27a1f703a5b8951d0063982baf65cd8b492110e79c05c73c2f9
3
+ metadata.gz: 05d33501383838004a5dbf7f99fc83f9a28eebdd8a85e54bc738672200cbbf37
4
+ data.tar.gz: 943cf0cec5a82ee8a05c53c6886df77c1277cfeb3e3f8aa8a8e8cd8358cd2ea2
5
5
  SHA512:
6
- metadata.gz: 7398e433e4f12f75cbb807470c1562b569d683b846c84b3dac85c1e23e0cfc21f0365a42a3608d3d9ae7d5e412fa6d80b31ad20455ff587290c353a4b46acdd9
7
- data.tar.gz: 1848ced849205cc118ad6b21a64bcce9ca5e781ce5268445ce2f2e8cb84fee7aa52a7afc4561658da5b3069ef4d8b981d63f8d5cfff10b54a84c2ea1d280ff4b
6
+ metadata.gz: b1bfc3d36722722911ad9a7b96765966204b74cdcbfbe9432f58fc1f306097f15810c382c916f6afa53da1244b11ec5b7b0d4d8b1b538e7cb264547081eaacea
7
+ data.tar.gz: aefd48071e6c2802a5636a94315acd8864282624754b55caedd704270d6c106d9aa1487a2d9597949e64eed44e206701524c593ac62374f6eec18089b5d052ee
data/CHANGELOG.md CHANGED
@@ -14,3 +14,9 @@
14
14
  ### Added
15
15
 
16
16
  - Introduce github action for releasing the gem once is merged into master
17
+
18
+ ## [0.3.0] - 2023-11-29
19
+
20
+ ### Added
21
+
22
+ - Introduce github action for building, linting and running specs anytime a pull request is opened or push to master happens
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Harmoniser
2
2
 
3
- A minimalistic approach to communicate with RabbitMQ.
3
+ [![Gem Version](https://badge.fury.io/rb/harmoniser.svg)](https://badge.fury.io/rb/harmoniser)
4
+ ![CI workflow](https://github.com/jollopre/harmoniser/actions/workflows/ci.yml/badge.svg)
5
+
6
+ A minimalistic approach to communicating with RabbitMQ.
4
7
 
5
8
  Harmoniser uses [Bunny](https://github.com/ruby-amqp/bunny) as a low level library to communicate with RabbitMQ in order to integrate publishing and messages consuming.
6
9
 
data/harmoniser.gemspec CHANGED
@@ -8,11 +8,11 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Jose Lloret"]
9
9
  spec.email = ["jollopre@gmail.com"]
10
10
 
11
- spec.summary = "A minimalistic approach to communicate with RabbitMQ"
12
- spec.description = "A declarative approach to communicate with RabbitMQ, that uses the reference low level library, to integrate publishing and consuming of messages"
11
+ spec.summary = "A minimalistic approach to communicating with RabbitMQ"
12
+ spec.description = "A declarative approach to communicating with RabbitMQ that makes it easy to integrate publishing and consuming messages"
13
13
  spec.homepage = "https://github.com/jollopre/harmoniser"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.7.0"
15
+ spec.required_ruby_version = ">= 3.2"
16
16
 
17
17
  spec.metadata = {
18
18
  "homepage_uri" => spec.homepage,
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_runtime_dependency "bunny", "~> 2.22"
28
28
  spec.add_development_dependency "rake", "~> 13.0"
29
- spec.add_development_dependency "rspec", "~> 3.0"
29
+ spec.add_development_dependency "rspec", "~> 3"
30
30
  spec.add_development_dependency "standardrb", "~> 1.0"
31
31
  end
@@ -20,14 +20,14 @@ module Harmoniser
20
20
  }
21
21
  MUTEX = Mutex.new
22
22
 
23
- attr_reader :connection, :connection_opts, :logger, :options
23
+ attr_reader :connection_opts, :logger, :options
24
24
  def_delegators :options, :environment, :require, :verbose
25
25
 
26
26
  def initialize
27
27
  @logger = Logger.new($stdout, progname: "harmoniser@#{VERSION}")
28
28
  @options = Options.new(**default_options)
29
29
  set_logger_severity
30
- @connection_opts = DEFAULT_CONNECTION_OPTS.merge({ logger: @logger })
30
+ @connection_opts = DEFAULT_CONNECTION_OPTS.merge({logger: @logger})
31
31
  @topology = Topology.new
32
32
  end
33
33
 
@@ -39,7 +39,7 @@ module Harmoniser
39
39
 
40
40
  def connection
41
41
  MUTEX.synchronize do
42
- @connection = Connection.new(connection_opts) unless @connection
42
+ @connection ||= Connection.new(connection_opts)
43
43
  @connection.start unless @connection.open?
44
44
  @connection
45
45
  end
@@ -51,8 +51,8 @@ module Harmoniser
51
51
  @connection_opts = connection_opts.merge(opts)
52
52
  end
53
53
 
54
- def options_with(**kwargs)
55
- @options = options.with(**kwargs)
54
+ def options_with(**)
55
+ @options = options.with(**)
56
56
  set_logger_severity
57
57
  end
58
58
 
@@ -67,10 +67,10 @@ module Harmoniser
67
67
  end
68
68
 
69
69
  def set_logger_severity
70
- if @options.production?
71
- @logger.level = @options.verbose? ? Logger::DEBUG : Logger::INFO
70
+ @logger.level = if @options.production?
71
+ @options.verbose? ? Logger::DEBUG : Logger::INFO
72
72
  else
73
- @logger.level = Logger::DEBUG
73
+ Logger::DEBUG
74
74
  end
75
75
  end
76
76
  end
@@ -34,7 +34,7 @@ module Harmoniser
34
34
  end
35
35
 
36
36
  def stop_subscribers
37
- @logger.info("Connection will be closed: connection = `#{@configuration.connection.to_s}`")
37
+ @logger.info("Connection will be closed: connection = `#{@configuration.connection}`")
38
38
  @configuration.connection.close
39
39
  end
40
40
 
@@ -3,7 +3,7 @@ require "harmoniser/definition"
3
3
 
4
4
  module Harmoniser
5
5
  module Publisher
6
- class MissingExchangeDefinition < StandardError ; end
6
+ class MissingExchangeDefinition < StandardError; end
7
7
  include Channelable
8
8
  MUTEX = Mutex.new
9
9
  private_constant :MUTEX
@@ -13,7 +13,7 @@ module Harmoniser
13
13
  @harmoniser_exchange_definition = Definition::Exchange.new(
14
14
  name: exchange_name,
15
15
  type: nil,
16
- opts: { passive: true }
16
+ opts: {passive: true}
17
17
  )
18
18
  end
19
19
 
@@ -4,7 +4,7 @@ require "harmoniser/includable"
4
4
 
5
5
  module Harmoniser
6
6
  module Subscriber
7
- class MissingConsumerDefinition < StandardError ; end
7
+ class MissingConsumerDefinition < StandardError; end
8
8
  include Channelable
9
9
  include Includable
10
10
  MUTEX = Mutex.new
@@ -64,7 +64,7 @@ module Harmoniser
64
64
  if binding.queue?
65
65
  channel.queue_bind(binding.destination_name, binding.exchange_name, binding.opts)
66
66
  elsif binding.exchange?
67
- ;
67
+
68
68
  end
69
69
  end
70
70
  end
@@ -1,3 +1,3 @@
1
1
  module Harmoniser
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harmoniser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Lloret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-27 00:00:00.000000000 Z
11
+ date: 2023-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: standardrb
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,8 +66,8 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
- description: A declarative approach to communicate with RabbitMQ, that uses the reference
70
- low level library, to integrate publishing and consuming of messages
69
+ description: A declarative approach to communicating with RabbitMQ that makes it easy
70
+ to integrate publishing and consuming messages
71
71
  email:
72
72
  - jollopre@gmail.com
73
73
  executables:
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 2.7.0
117
+ version: '3.2'
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="
@@ -124,5 +124,5 @@ requirements: []
124
124
  rubygems_version: 3.4.10
125
125
  signing_key:
126
126
  specification_version: 4
127
- summary: A minimalistic approach to communicate with RabbitMQ
127
+ summary: A minimalistic approach to communicating with RabbitMQ
128
128
  test_files: []