ruby_rabbitmq_janus 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 694bb6d6f4373b3c753ac5d1ee1b6419b85d9834
4
- data.tar.gz: 9bf631f452ed3473da2fe1327dca499f232bde3b
3
+ metadata.gz: 1252bb3529447bd0b1dd68c762d627291555ac15
4
+ data.tar.gz: f50e5c4f10ebeb0e258153e5900559f49424d6e9
5
5
  SHA512:
6
- metadata.gz: d1794b626b64941e5bf2977c2c7bc1923af99f17204b8ca57737ec021eb41e557daba310146717a166e96ee586667596eab309fa20302ea6e636371d76c69ad0
7
- data.tar.gz: 56cb33b022b9ccff9d78f7ef5fa2bffddfa640db804b5c91582a2edeeab5185a33f0f8a5a9dfcdab71e3d447f919921a33e7adffcb5c6f1eecb09777827f2452
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
@@ -3,7 +3,7 @@
3
3
  # Define constant to gem.
4
4
  module RubyRabbitmqJanus
5
5
  # Define version to gem
6
- VERSION = '1.0.8'
6
+ VERSION = '1.1.0'
7
7
 
8
8
  # Define a summary description to gem
9
9
  SUMMARY = 'Ruby RabbitMQ Janus'
@@ -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']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_rabbitmq_janus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VAILLANT Jeremy