ruby_rabbitmq_janus 3.0.1 → 4.0.0.pre.850041590
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/default.yml +5 -5
- data/lib/rrj/errors/rabbit/rabbit.rb +32 -34
- data/lib/rrj/info.rb +1 -1
- data/lib/rrj/models/active_record.rb +1 -3
- data/lib/rrj/rabbit/connect.rb +6 -6
- data/lib/rrj/tools/gem/config.rb +1 -1
- data/lib/rrj/tools/replaces/replace.rb +2 -2
- data/spec/config/database.yml +1 -0
- data/spec/ruby_rabbitmq_janus/models/janus_instance_instance_spec.rb +1 -1
- data/spec/ruby_rabbitmq_janus/process/concurrencies/concurrency_spec.rb +1 -2
- data/spec/ruby_rabbitmq_janus/process/concurrencies/event_admin_spec.rb +1 -2
- data/spec/ruby_rabbitmq_janus/process/concurrencies/event_spec.rb +1 -2
- data/spec/ruby_rabbitmq_janus/rrj_admin_add_token_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_allow_token_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_disallow_token_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_handle_info_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/{rrj_admin_list_handles_spec.Rb → rrj_admin_list_handles_spec.rb} +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_list_sessions_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_list_tokens_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_remove_token_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_libnice_debug_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_locking_debug_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_log_colors_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_log_level_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_log_timestamps_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_max_nack_queue_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_no_media_timer_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_set_session_timeout_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_start_pcap_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_start_text2pcap_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_stop_pcap_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_admin_stop_text2pcap_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_answer_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_attach_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_create_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_destroy_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_detach_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_info_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_keepalive_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_offer_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_trickle_spec.rb +1 -0
- data/spec/ruby_rabbitmq_janus/rrj_trickles_spec.rb +2 -1
- data/spec/spec_helper.rb +34 -37
- metadata +152 -125
- data/tmp/coverage/assets/0.10.2/application.css +0 -799
- data/tmp/coverage/assets/0.10.2/application.js +0 -1707
- data/tmp/coverage/assets/0.10.2/colorbox/border.png +0 -0
- data/tmp/coverage/assets/0.10.2/colorbox/controls.png +0 -0
- data/tmp/coverage/assets/0.10.2/colorbox/loading.gif +0 -0
- data/tmp/coverage/assets/0.10.2/colorbox/loading_background.png +0 -0
- data/tmp/coverage/assets/0.10.2/favicon_green.png +0 -0
- data/tmp/coverage/assets/0.10.2/favicon_red.png +0 -0
- data/tmp/coverage/assets/0.10.2/favicon_yellow.png +0 -0
- data/tmp/coverage/assets/0.10.2/loading.gif +0 -0
- data/tmp/coverage/assets/0.10.2/magnify.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/tmp/coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/tmp/coverage/index.html +0 -21519
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d2de468e1a126345a12e766cb4e8084596f1dcbc9e723cb04cb84aeb08da1ea
|
4
|
+
data.tar.gz: 7abc77fcbc6d4b1933c3cb12b3ef0bf261e8fd5dce5dad763557b27ffb9bbf70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f067f57efb5947d0c1897a4cab46bdc3b9ec052a5a67b62cf016d4cba61333df4f9b86f38bcf9311a850e4838814e07f4bd45e75761370bf973d73007119fbcc
|
7
|
+
data.tar.gz: bd68ad010e4f72df7cc35afe6b9f818e29e6aef44d14018c09ed06bec982509438fb0a8272987c596b4c28b72894f7b5d4a4f659b2cb001fded8383867b6b930
|
data/config/default.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Rabbit information connection
|
2
2
|
rabbit:
|
3
3
|
# Precise RabbitMQ host - Default 'localhost'
|
4
|
-
host:
|
4
|
+
host: rabbit
|
5
5
|
# Precise RabbitMQ port - Default '5672'
|
6
6
|
port: 5672
|
7
7
|
# Precise RabbitMQ vhost - Default '/'
|
@@ -13,7 +13,7 @@ rabbit:
|
|
13
13
|
# Password for admin request
|
14
14
|
admin_pass: janusoverlord
|
15
15
|
# Logger level for rabbitmq message
|
16
|
-
level:
|
16
|
+
level: error
|
17
17
|
|
18
18
|
# RabbitMQ Queue information
|
19
19
|
queues:
|
@@ -53,12 +53,12 @@ gem:
|
|
53
53
|
log:
|
54
54
|
# Define level to log
|
55
55
|
# UNKNOW, FATAL, ERROR, WARN, INFO, DEBUG
|
56
|
-
level:
|
56
|
+
level: info
|
57
57
|
# Precise type logger
|
58
58
|
# stdout : Output standard.
|
59
59
|
# file : Create log file in path 'log/ruby-rabbitmq-janus.log'.
|
60
60
|
# remote : Use RemoteSyslogLogger (for papertrail)
|
61
|
-
type:
|
61
|
+
type: stdout
|
62
62
|
# Used with type. Complete missing data :
|
63
63
|
# stdout : no option
|
64
64
|
# file : filename used
|
@@ -73,7 +73,7 @@ gem:
|
|
73
73
|
environment : 'development'
|
74
74
|
# Precise ORM used :
|
75
75
|
# mongoid or active_record
|
76
|
-
orm: 'mongoid'
|
76
|
+
orm: <%= ENV['MONGO'].eql?('true') ? 'mongoid' : 'active_record' %>
|
77
77
|
# Read response json for RSpec
|
78
78
|
response_path: 'spec/supports/rrj/responses'
|
79
79
|
# Number of process read public queue
|
@@ -2,52 +2,50 @@
|
|
2
2
|
|
3
3
|
module RubyRabbitmqJanus
|
4
4
|
module Errors
|
5
|
-
module Rabbit
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
super "[Rabbit]#{message}", level
|
10
|
-
end
|
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
|
11
9
|
end
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
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'
|
19
17
|
end
|
18
|
+
end
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
20
|
+
# Error When transaction timeout
|
21
|
+
class TransactionTimeout < RubyRabbitmqJanus::Errors::BaseRabbit
|
22
|
+
def initialize(error)
|
23
|
+
super error
|
26
24
|
end
|
27
25
|
end
|
26
|
+
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
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})"
|
35
33
|
end
|
34
|
+
end
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
36
|
+
# Error when response is nil
|
37
|
+
class ResponseNil < RubyRabbitmqJanus::Errors::BaseRabbit
|
38
|
+
def initialize(response)
|
39
|
+
super "Response is nil ! (#{response})"
|
42
40
|
end
|
43
41
|
end
|
42
|
+
end
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
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})"
|
51
49
|
end
|
52
50
|
end
|
53
51
|
end
|
data/lib/rrj/info.rb
CHANGED
@@ -32,11 +32,9 @@ module RubyRabbitmqJanus
|
|
32
32
|
#
|
33
33
|
# @return [Hash] Current model
|
34
34
|
#
|
35
|
-
# rubocop:disable Style/HashTransformValues
|
36
35
|
def unset(attributes)
|
37
|
-
|
36
|
+
[attributes.map { |key, _value| [key, nil] }].to_h
|
38
37
|
end
|
39
|
-
# rubocop:enable Style/HashTransformValues
|
40
38
|
end
|
41
39
|
end
|
42
40
|
end
|
data/lib/rrj/rabbit/connect.rb
CHANGED
@@ -15,7 +15,7 @@ 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 Errors::
|
18
|
+
raise RubyRabbitmqJanus::Errors::Connect::MissingAction unless block
|
19
19
|
|
20
20
|
response = nil
|
21
21
|
|
@@ -23,8 +23,8 @@ module RubyRabbitmqJanus
|
|
23
23
|
response = transaction_long(&block)
|
24
24
|
end
|
25
25
|
rescue Timeout::Error
|
26
|
-
raise Errors::
|
27
|
-
|
26
|
+
raise RubyRabbitmqJanus::Errors::Connect::TransactionTimeout, \
|
27
|
+
'The "Short transaction" have raised Timeout exception.'
|
28
28
|
ensure
|
29
29
|
close
|
30
30
|
response
|
@@ -32,15 +32,15 @@ module RubyRabbitmqJanus
|
|
32
32
|
|
33
33
|
# Create an transaction with rabbitmq and not close
|
34
34
|
def transaction_long
|
35
|
-
raise Errors::
|
35
|
+
raise RubyRabbitmqJanus::Errors::Connect::MissingAction unless block_given?
|
36
36
|
|
37
37
|
Timeout.timeout(60) do
|
38
38
|
start
|
39
39
|
yield
|
40
40
|
end
|
41
41
|
rescue Timeout::Error
|
42
|
-
raise Errors::
|
43
|
-
|
42
|
+
raise RubyRabbitmqJanus::Errors::Connect::TransactionTimeout, \
|
43
|
+
'The "Long transaction" have raised Timeout exception.'
|
44
44
|
end
|
45
45
|
|
46
46
|
# Opening a connection with RabbitMQ
|
data/lib/rrj/tools/gem/config.rb
CHANGED
data/spec/config/database.yml
CHANGED
@@ -16,7 +16,7 @@ describe RubyRabbitmqJanus::Models::JanusInstance, type: :model,
|
|
16
16
|
let(:id) { first.id }
|
17
17
|
|
18
18
|
context 'when Janus instances are activated.' do
|
19
|
-
let(:instances) { FactoryBot.create_list(:janus_instance, size) }
|
19
|
+
let(:instances) { FactoryBot.create_list(:janus_instance, size, enable: true) }
|
20
20
|
let(:count_enabled) { size }
|
21
21
|
let(:count_destroyed) { 0 }
|
22
22
|
let(:count_disabled) { 0 }
|
@@ -3,8 +3,7 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe RubyRabbitmqJanus::Process::Concurrencies::EventAdmin, type: :thread,
|
6
|
-
name: :event_admin
|
7
|
-
retry: 3 do
|
6
|
+
name: :event_admin do
|
8
7
|
let(:publish_name) { :pub_admin }
|
9
8
|
let(:listener) { RubyRabbitmqJanus::Rabbit::Listener::FromAdmin }
|
10
9
|
let(:exception_runner) { RubyRabbitmqJanus::Errors::Process::EventAdmin::Run }
|
@@ -3,8 +3,7 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe RubyRabbitmqJanus::Process::Concurrencies::Event, type: :thread,
|
6
|
-
name: :event
|
7
|
-
retry: 3 do
|
6
|
+
name: :event do
|
8
7
|
let(:publish_name) { :pub_classic }
|
9
8
|
let(:listener) { RubyRabbitmqJanus::Rabbit::Listener::From }
|
10
9
|
let(:exception_runner) { RubyRabbitmqJanus::Errors::Process::Event::Run }
|