ruby_rabbitmq_janus 3.0.1 → 4.0.0.pre.939137013
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 +7 -6
- data/lib/rrj/rails.rb +2 -2
- 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} +2 -1
- 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 +12 -39
- 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: 826e350f59661d1728915d109edf5b31b271b5c54f9c6416807f0e1c5a673aa7
|
4
|
+
data.tar.gz: 141de1cec6f01becb59e658a3c199012f00defc9c3d55759236c4bd45e9519a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7b9e383e3c16d3163336ab19b2bc8b6f9368a0a96356c3043cc6b5d4a333d6c2efbbb71ea66a985c5c768ad62c8d11c56be7478635a66243dd3f9b8287c868a
|
7
|
+
data.tar.gz: c578835476ba0c0f3e796cf8deb54a6eb2d344f0418582bef6e9c749be95fbbccdc1de8ba0d00f3270e183c279965b89f47ca41748ac865b9ca169c62b73e658
|
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,16 @@ 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 \
|
36
|
+
unless block_given?
|
36
37
|
|
37
38
|
Timeout.timeout(60) do
|
38
39
|
start
|
39
40
|
yield
|
40
41
|
end
|
41
42
|
rescue Timeout::Error
|
42
|
-
raise Errors::
|
43
|
-
|
43
|
+
raise RubyRabbitmqJanus::Errors::Connect::TransactionTimeout, \
|
44
|
+
'The "Long transaction" have raised Timeout exception.'
|
44
45
|
end
|
45
46
|
|
46
47
|
# Opening a connection with RabbitMQ
|
data/lib/rrj/rails.rb
CHANGED
@@ -22,8 +22,8 @@ module RubyRabbitmqJanus
|
|
22
22
|
|
23
23
|
Log.debug "[RRJ] Create process : #{number}"
|
24
24
|
process = RubyRabbitmqJanus::Process::Concurrencies
|
25
|
-
actions =
|
26
|
-
admin_actions =
|
25
|
+
actions = ActionEvents.new.actions
|
26
|
+
admin_actions = ActionAdminEvents.new.actions
|
27
27
|
|
28
28
|
listeners = []
|
29
29
|
(1..number).each do
|
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 }
|
data/spec/ruby_rabbitmq_janus/{rrj_admin_list_handles_spec.Rb → rrj_admin_list_handles_spec.rb}
RENAMED
@@ -4,6 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe RubyRabbitmqJanus::RRJAdmin, type: :request,
|
6
6
|
level: :admin,
|
7
|
+
broken: true,
|
7
8
|
name: :list_handles do
|
8
9
|
before { helper_janus_instance_without_token }
|
9
10
|
|
@@ -12,7 +13,7 @@ describe RubyRabbitmqJanus::RRJAdmin, type: :request,
|
|
12
13
|
let(:schema_success) { type }
|
13
14
|
let(:parameter) { {} }
|
14
15
|
|
15
|
-
context 'request #list_handles' do
|
16
|
+
context 'when request #list_handles' do
|
16
17
|
context 'when no session/handle' do
|
17
18
|
let(:exception_class) { RubyRabbitmqJanus::Errors::Janus::Responses::InvalidRequestPath }
|
18
19
|
let(:exception_message) { "[457] Reason : Unhandled request 'list_handles' at this path" }
|