ruby_rabbitmq_janus 1.1.10 → 1.1.11
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 +4 -4
- data/lib/rrj/info.rb +1 -1
- data/lib/rrj/init.rb +2 -3
- data/lib/rrj/tools/replaces/replace.rb +3 -2
- data/lib/rrj/tools/replaces/standard.rb +1 -1
- data/lib/rrj/tools/replaces/type.rb +36 -0
- data/lib/rrj/tools/tools.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9b61ef4e2646b0657f82798b2e62194be6530d9
|
4
|
+
data.tar.gz: 82a2f520d758ece417619ec8c799bafd383d0391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ed0c4205fed937d45a2150cb464ef58262449687da7be2b30b4c5801b8a65c0ccb1fa42f835e099d45464ea1d411ebfa062eed5c731c7aecbea5eb2531f8510
|
7
|
+
data.tar.gz: 500d380c18b876f8f24489f723f1dd726c3a34c40dec3fd1e51646a1c195c243d41110cd0cf4590311d98042f37a1b75b0a6bc0e377ccee4331d0e2631f6e770
|
data/lib/rrj/info.rb
CHANGED
data/lib/rrj/init.rb
CHANGED
@@ -81,9 +81,8 @@ module RubyRabbitmqJanus
|
|
81
81
|
# @return [RubyRabbitmqJanus::Janus::Responses::Standard]
|
82
82
|
# Give an object response to janus server
|
83
83
|
def message_admin(type, options = {})
|
84
|
-
Janus::Transactions::Admin.new(
|
85
|
-
Janus::Messages::Admin.new(type,
|
86
|
-
options.merge!('session_id' => @session))
|
84
|
+
Janus::Transactions::Admin.new(use_current_session?(options)).connect do
|
85
|
+
Janus::Messages::Admin.new(type, options)
|
87
86
|
end
|
88
87
|
end
|
89
88
|
|
@@ -11,6 +11,7 @@ module RubyRabbitmqJanus
|
|
11
11
|
def initialize(request, options = {})
|
12
12
|
@request = request
|
13
13
|
@opts = options
|
14
|
+
@type = Tools::Type.new(@request)
|
14
15
|
Tools::Log.instance.debug "Element to replace : #{@opts}"
|
15
16
|
end
|
16
17
|
|
@@ -28,7 +29,7 @@ module RubyRabbitmqJanus
|
|
28
29
|
|
29
30
|
private
|
30
31
|
|
31
|
-
attr_reader :request, :opts
|
32
|
+
attr_reader :request, :opts, :type
|
32
33
|
|
33
34
|
# Replace basic elements
|
34
35
|
def replace_classic
|
@@ -48,7 +49,7 @@ module RubyRabbitmqJanus
|
|
48
49
|
|
49
50
|
# Read option session and replace in request
|
50
51
|
def replace_session
|
51
|
-
@request['session_id'] = @
|
52
|
+
@request['session_id'] = @type.convert('session_id', @opts)
|
52
53
|
rescue => message
|
53
54
|
Tools::Log.instance.warn "Error session replace : #{message}"
|
54
55
|
end
|
@@ -18,7 +18,7 @@ module RubyRabbitmqJanus
|
|
18
18
|
|
19
19
|
# Replace handle integer
|
20
20
|
def replace_handle
|
21
|
-
request['handle_id'] =
|
21
|
+
request['handle_id'] = type.convert('handle_id', opts)
|
22
22
|
rescue => message
|
23
23
|
Tools::Log.instance.warn "Error handle replace : #{message}"
|
24
24
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubyRabbitmqJanus
|
4
|
+
module Tools
|
5
|
+
# Class for converting elemnts given by apps to this gem an type conform
|
6
|
+
# to request sending
|
7
|
+
class Type
|
8
|
+
# Initalize an object for cast a type to data given by app
|
9
|
+
def initialize(request)
|
10
|
+
@request = request
|
11
|
+
@data = nil
|
12
|
+
end
|
13
|
+
|
14
|
+
# Return an data with a type corresponding to string in request
|
15
|
+
def convert(key, option)
|
16
|
+
@data = option[key]
|
17
|
+
case @request[key]
|
18
|
+
when '<string>' then convert_to_type_string
|
19
|
+
when '<number>' then convert_to_type_number
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
# Convert a data to String type
|
26
|
+
def convert_to_type_string
|
27
|
+
@data.to_s
|
28
|
+
end
|
29
|
+
|
30
|
+
# Convert a data to Integer type
|
31
|
+
def convert_to_type_number
|
32
|
+
@data.to_i
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/rrj/tools/tools.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_rabbitmq_janus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VAILLANT Jeremy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -365,6 +365,7 @@ files:
|
|
365
365
|
- lib/rrj/tools/replaces/admin.rb
|
366
366
|
- lib/rrj/tools/replaces/replace.rb
|
367
367
|
- lib/rrj/tools/replaces/standard.rb
|
368
|
+
- lib/rrj/tools/replaces/type.rb
|
368
369
|
- lib/rrj/tools/requests.rb
|
369
370
|
- lib/rrj/tools/tools.rb
|
370
371
|
- lib/ruby_rabbitmq_janus.rb
|