ruby_rabbitmq_janus 4.0.0.pre.1001132533 → 4.0.1.pre.1265140558

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: dd2d7317eb7181b723b6baa16fcb067e53a36fb5987299c554d42d9e688bcf3c
4
- data.tar.gz: 90e0b0b234075667eb5ecdfa5ad008aa1e896eaa9b466d84873dfe30c0a68975
3
+ metadata.gz: a7bd366c773c87d7099fa5877216f8bdd053069dcc799bbd37d7b86d96297197
4
+ data.tar.gz: b0c402d3316c96117a3d7cde67206dec284b7ddf3c5d54faed6cfd9a80b96bb6
5
5
  SHA512:
6
- metadata.gz: d40f13710b58f769f028b94252d8039350baf0954a8df0dff4ee8d0abf5d96edd11a4dd86e44d5a4d7cec2281554da06d3d133108ab9dc78cbd9e625b18982e4
7
- data.tar.gz: a26df2b64540d038fccac299e7ac4a9f289d91283e2a1c0d50c8c89ec387b657dab56714075f70c8406904796f1c632d8506b6769dca3b39b2e14c46b44ce193
6
+ metadata.gz: 4c823626f3eac6a1ef486eac346862dbd64ce62f069068cce187242e48c5c4cf7e8971e3d6194ba56d0f0c7f89037fb99957c422470bd59abe0b3d4670e39fb7
7
+ data.tar.gz: 89a5c209d43f8c958d8444700859cdab404b01947f7e4b09e4b2eff2a6c72060d1cf019e7e3bd41a56988251951319e5dbab7d9f6b0f414b8e717d34037c4ffc
data/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  [![Linter](https://github.com/dazzl-tv/ruby-rabbitmq-janus/actions/workflows/linter.yml/badge.svg)](https://github.com/dazzl-tv/ruby-rabbitmq-janus/actions/workflows/linter.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/ruby_rabbitmq_janus.svg)](https://badge.fury.io/rb/ruby_rabbitmq_janus)
5
5
  [![Docs](https://inch-ci.org/github/dazzl-tv/ruby-rabbitmq-janus.svg)](https://inch-ci.org/github/dazzl-tv/ruby-rabbitmq-janus)
6
- [![Maintainability](https://api.codeclimate.com/v1/badges/44e8680ad5e96d109be2/maintainability)](https://codeclimate.com/github/dazzl-tv/ruby-rabbitmq-janus/maintainability)
7
- [![Test Coverage](https://api.codeclimate.com/v1/badges/44e8680ad5e96d109be2/test_coverage)](https://codeclimate.com/github/dazzl-tv/ruby-rabbitmq-janus/test_coverage)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/f1eda688803e829438a7/maintainability)](https://codeclimate.com/github/dazzl-tv/ruby-rabbitmq-janus/maintainability)
7
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/f1eda688803e829438a7/test_coverage)](https://codeclimate.com/github/dazzl-tv/ruby-rabbitmq-janus/test_coverage)
8
8
  [![Known Vulnerabilities](https://snyk.io/test/github/dazzl-tv/ruby-rabbitmq-janus/badge.svg)](https://snyk.io/test/github/dazzl-tv/ruby-rabbitmq-janus)
9
9
 
10
10
  Ruby Gem for Janus WebRTC Gateway integration using RabbitMQ message queue
@@ -2,50 +2,52 @@
2
2
 
3
3
  module RubyRabbitmqJanus
4
4
  module Errors
5
- # Define a super class for all error in module Rabbit
6
- class BaseRabbit < RRJError
7
- def initialize(message, level = :fatal)
8
- super "[Rabbit]#{message}", level
5
+ module Rabbit
6
+ # Define a super class for all error in module Rabbit
7
+ class Base < RRJError
8
+ def initialize(message, level = :fatal)
9
+ super "[Rabbit]#{message}", level
10
+ end
9
11
  end
10
- end
11
12
 
12
- module Connect
13
- # Error when transaction hs no block
14
- class MissingAction < RubyRabbitmqJanus::Errors::BaseRabbit
15
- def initialize
16
- super 'Transaction failed, missing block'
13
+ module Connect
14
+ # Error when transaction hs no block
15
+ class MissingAction < RubyRabbitmqJanus::Errors::Rabbit::Base
16
+ def initialize
17
+ super 'Transaction failed, missing block'
18
+ end
17
19
  end
18
- end
19
20
 
20
- # Error When transaction timeout
21
- class TransactionTimeout < RubyRabbitmqJanus::Errors::BaseRabbit
22
- def initialize(error)
23
- super error
21
+ # Error When transaction timeout
22
+ class TransactionTimeout < RubyRabbitmqJanus::Errors::Rabbit::Base
23
+ def initialize(error)
24
+ super error
25
+ end
24
26
  end
25
27
  end
26
- end
27
28
 
28
- module Listener
29
- # Error when response is empty
30
- class ResponseEmpty < RubyRabbitmqJanus::Errors::BaseRabbit
31
- def initialize(response)
32
- super "Response is empty ! (#{response})"
29
+ module Listener
30
+ # Error when response is empty
31
+ class ResponseEmpty < RubyRabbitmqJanus::Errors::Rabbit::Base
32
+ def initialize(response)
33
+ super "Response is empty ! (#{response})"
34
+ end
33
35
  end
34
- end
35
36
 
36
- # Error when response is nil
37
- class ResponseNil < RubyRabbitmqJanus::Errors::BaseRabbit
38
- def initialize(response)
39
- super "Response is nil ! (#{response})"
37
+ # Error when response is nil
38
+ class ResponseNil < RubyRabbitmqJanus::Errors::Rabbit::Base
39
+ def initialize(response)
40
+ super "Response is nil ! (#{response})"
41
+ end
40
42
  end
41
43
  end
42
- end
43
44
 
44
- module Publisher
45
- # Error when correlation string is not equal
46
- class TestCorrelation < RubyRabbitmqJanus::Errors::BaseRabbit
47
- def initialize(message, propertie)
48
- super "Correlation doesn't equal (msg: #{message}) != (prp: #{propertie})"
45
+ module Publisher
46
+ # Error when correlation string is not equal
47
+ class TestCorrelation < RubyRabbitmqJanus::Errors::Rabbit::Base
48
+ def initialize(message, propertie)
49
+ super "Correlation doesn't equal (msg: #{message}) != (prp: #{propertie})"
50
+ end
49
51
  end
50
52
  end
51
53
  end
data/lib/rrj/info.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # Define constant to gem.
7
7
  module RubyRabbitmqJanus
8
8
  # Define version to gem
9
- VERSION = '4.0.0'
9
+ VERSION = '4.0.1'
10
10
 
11
11
  # Name to gem
12
12
  GEM_NAME = 'ruby_rabbitmq_janus'
@@ -15,7 +15,8 @@ module RubyRabbitmqJanus
15
15
 
16
16
  # Create an transaction with rabbitmq and close after response is received
17
17
  def transaction_short(&block)
18
- raise RubyRabbitmqJanus::Errors::Connect::MissingAction unless block
18
+ raise RubyRabbitmqJanus::Errors::Rabbit::Connect::MissingAction \
19
+ unless block
19
20
 
20
21
  response = nil
21
22
 
@@ -23,7 +24,7 @@ module RubyRabbitmqJanus
23
24
  response = transaction_long(&block)
24
25
  end
25
26
  rescue Timeout::Error
26
- raise RubyRabbitmqJanus::Errors::Connect::TransactionTimeout, \
27
+ raise RubyRabbitmqJanus::Errors::Rabbit::Connect::TransactionTimeout, \
27
28
  'The "Short transaction" have raised Timeout exception.'
28
29
  ensure
29
30
  close
@@ -32,7 +33,7 @@ module RubyRabbitmqJanus
32
33
 
33
34
  # Create an transaction with rabbitmq and not close
34
35
  def transaction_long
35
- raise RubyRabbitmqJanus::Errors::Connect::MissingAction \
36
+ raise RubyRabbitmqJanus::Errors::Rabbit::Connect::MissingAction \
36
37
  unless block_given?
37
38
 
38
39
  Timeout.timeout(60) do
@@ -40,7 +41,7 @@ module RubyRabbitmqJanus
40
41
  yield
41
42
  end
42
43
  rescue Timeout::Error
43
- raise RubyRabbitmqJanus::Errors::Connect::TransactionTimeout, \
44
+ raise RubyRabbitmqJanus::Errors::Rabbit::Connect::TransactionTimeout, \
44
45
  'The "Long transaction" have raised Timeout exception.'
45
46
  end
46
47
 
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'simplecov'
4
+ require 'simplecov_json_formatter'
5
+
6
+ SimpleCov.start
7
+ SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
4
8
 
5
9
  # Load gems dependencies
6
10
  require 'bundler/setup'
@@ -16,7 +20,6 @@ else
16
20
  require 'active_record'
17
21
  require 'database_cleaner/active_record'
18
22
  end
19
- # require ENV['MONGO'].match?('true') ? 'mongoid' : 'active_record'
20
23
  require 'timeout'
21
24
 
22
25
  # Load gem RubyRabbitmqJanus