ruby_rabbitmq_janus 1.0.8 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +6 -0
- data/lib/rrj/info.rb +1 -1
- data/lib/rrj/tools/replaces.rb +28 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1252bb3529447bd0b1dd68c762d627291555ac15
|
4
|
+
data.tar.gz: f50e5c4f10ebeb0e258153e5900559f49424d6e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 108033fd212c50b694131cef62296dd086b0ee950092877ea0f50d03cfd769f194f78849f5ac245d3ef4c336af6edb63dc12bdad76acbf11429f046477c75943
|
7
|
+
data.tar.gz: 5bfa8a59e521674ae156b81f6cf55810a4405938d7b36e505846a15199e03cc941553e64c65bea3584f9833778ee0fe85dfa0362c125d44183599241660c4a18
|
data/.gitignore
CHANGED
@@ -61,11 +61,17 @@ config/ruby-rabbitmq-janus.yml
|
|
61
61
|
## Request customize
|
62
62
|
config/requests/channel
|
63
63
|
config/requests/videocast
|
64
|
+
config/requests/peer
|
64
65
|
|
65
66
|
## Schema JSON response
|
66
67
|
spec/support/schemas/request/channel
|
67
68
|
spec/support/schemas/request/videocast
|
69
|
+
spec/support/schemas/request/peer
|
70
|
+
|
71
|
+
## Support RSpec
|
72
|
+
spec/support/examples_peer.rb
|
68
73
|
|
69
74
|
## Unitaire test for request customize
|
70
75
|
spec/request/channel
|
71
76
|
spec/request/videocast
|
77
|
+
spec/request/peer
|
data/lib/rrj/info.rb
CHANGED
data/lib/rrj/tools/replaces.rb
CHANGED
@@ -4,6 +4,7 @@ module RubyRabbitmqJanus
|
|
4
4
|
module Tools
|
5
5
|
# Format message request with good data to HASH format
|
6
6
|
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
7
|
+
# :reek:TooManyMethods
|
7
8
|
class Replace
|
8
9
|
# Initialize a tool replace
|
9
10
|
def initialize(request, options = {})
|
@@ -33,6 +34,7 @@ module RubyRabbitmqJanus
|
|
33
34
|
replace_session if @request.key?('session_id')
|
34
35
|
replace_plugin if @request.key?('plugin')
|
35
36
|
replace_handle if @request.key?('handle_id')
|
37
|
+
replace_candidate if @request.key?('candidate')
|
36
38
|
end
|
37
39
|
|
38
40
|
# Create an transaction string and replace in request field with an String format
|
@@ -63,6 +65,32 @@ module RubyRabbitmqJanus
|
|
63
65
|
Tools::Log.instance.warn "Error handle replace : #{message}"
|
64
66
|
end
|
65
67
|
|
68
|
+
# Replace candidate, or candidates
|
69
|
+
def replace_candidate
|
70
|
+
save_candidate(candidates?)
|
71
|
+
rescue => message
|
72
|
+
Tools::Log.instance.warn "Error candidate replace : #{message}"
|
73
|
+
end
|
74
|
+
|
75
|
+
def save_candidate(value)
|
76
|
+
if @opts.key?('candidates')
|
77
|
+
@request['candidates'] = value
|
78
|
+
else
|
79
|
+
@request['candidate'] = value
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Test candidates or candidate
|
84
|
+
def candidates?
|
85
|
+
if @opts.key?('candidates')
|
86
|
+
@request['candidates'] = @request['candidate']
|
87
|
+
@request.delete('candidate')
|
88
|
+
@opts['candidates']
|
89
|
+
else
|
90
|
+
@opts['candidate']
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
66
94
|
# Replace other element in request
|
67
95
|
def replace_other
|
68
96
|
values = @opts['replace']
|