openvidu-ruby-client 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +6 -1
- data/lib/open_vidu/base.rb +4 -0
- data/lib/open_vidu/command.rb +4 -3
- data/lib/open_vidu/exceptions.rb +9 -0
- data/lib/open_vidu/recording.rb +4 -0
- data/lib/open_vidu/requestor.rb +1 -1
- data/lib/open_vidu/responder.rb +9 -1
- data/lib/open_vidu/session.rb +12 -0
- data/lib/open_vidu/version.rb +1 -1
- data/openvidu-ruby-client.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59a8122f21134fc2603ab6a8ee13db1688c30e8c
|
4
|
+
data.tar.gz: 822010be06300ead388a01be303fdd8a54a7fdb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5526e8ef1d05d2942df8bea05184452041502440b230652d36955fdc88519d19590df1abe5bd1b1aca557b5c0c22151902a4e0feaa2e7d0df08c94eb539cfe33
|
7
|
+
data.tar.gz: 1057d5c72a526ada260bbd5327641e6ee8198924ba04e301c9ec15a17f00f334ba4d17ac79cacef9a9c4a11dfbcfaf81aebaf17c3c9cb8afacf8583b8887e421
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -3,11 +3,16 @@ sudo: false
|
|
3
3
|
language: ruby
|
4
4
|
cache: bundler
|
5
5
|
rvm: 2.4.5
|
6
|
+
dist: bionic
|
6
7
|
|
7
8
|
services:
|
8
9
|
- docker
|
9
10
|
|
11
|
+
env:
|
12
|
+
OPENVIDU_VERIFY_PEER: false
|
13
|
+
|
10
14
|
before_install:
|
11
15
|
- gem install bundler -v 1.17.3
|
12
16
|
- docker pull openvidu/openvidu-server-kms
|
13
|
-
- docker run -p 4443:4443 -d --rm -e openvidu.secret=MY_SECRET openvidu/openvidu-server-kms
|
17
|
+
- docker run -p 4443:4443 -d --rm -e openvidu.secret=MY_SECRET -e openvidu.recording.path=/recordings -e openvidu.recording=true -v /var/run/docker.sock:/var/run/docker.sock openvidu/openvidu-server-kms
|
18
|
+
- while [[ "$(curl -k -uOPENVIDUAPP:MY_SECRET -s -o /dev/null -w ''%{http_code}'' https://localhost:4443)" != "200" ]]; do echo "Waiting for Openvidu..."; sleep 5; done
|
data/lib/open_vidu/base.rb
CHANGED
@@ -7,6 +7,10 @@ module OpenVidu
|
|
7
7
|
GENERATED_PARAMS = %w[].freeze
|
8
8
|
ALL_PARAMS = (ASSIGNABLE_PARAMS + GENERATED_PARAMS).freeze
|
9
9
|
|
10
|
+
def self.content_key
|
11
|
+
'content'
|
12
|
+
end
|
13
|
+
|
10
14
|
def initialize(params = {})
|
11
15
|
self.class::ALL_PARAMS.each do |param|
|
12
16
|
instance_variable_set("@#{param}", params[param.to_sym])
|
data/lib/open_vidu/command.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'open_vidu/requestor'
|
2
2
|
require 'open_vidu/responder'
|
3
|
+
require 'open_vidu/exceptions'
|
3
4
|
|
4
5
|
module OpenVidu
|
5
6
|
# Command
|
@@ -15,14 +16,14 @@ module OpenVidu
|
|
15
16
|
|
16
17
|
def execute
|
17
18
|
response = OpenVidu::Requestor.new(method, endpoint, params).execute
|
18
|
-
OpenVidu::
|
19
|
+
raise OpenVidu::ResponseError.new(response) unless valid?(response)
|
20
|
+
OpenVidu::Responder.new(object, response.parsed_response).execute
|
19
21
|
end
|
20
22
|
|
21
23
|
private
|
22
24
|
|
23
|
-
# TODO: Implement.
|
24
25
|
def valid?(response)
|
25
|
-
|
26
|
+
response.success?
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
data/lib/open_vidu/recording.rb
CHANGED
data/lib/open_vidu/requestor.rb
CHANGED
data/lib/open_vidu/responder.rb
CHANGED
@@ -15,11 +15,19 @@ module OpenVidu
|
|
15
15
|
return klass.new(mapped_params(response)) if complete_record?
|
16
16
|
return klass.find(response['id']) if record_lookup?
|
17
17
|
|
18
|
-
response[
|
18
|
+
response[content_key].map { |hash| klass.new(mapped_params(hash)) }
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
+
def klass
|
24
|
+
Object.const_get(klass_name)
|
25
|
+
end
|
26
|
+
|
27
|
+
def content_key
|
28
|
+
klass.content_key
|
29
|
+
end
|
30
|
+
|
23
31
|
def klass_name
|
24
32
|
"OpenVidu::#{object.to_s.split('_').map(&:capitalize).join('')}"
|
25
33
|
end
|
data/lib/open_vidu/session.rb
CHANGED
@@ -24,6 +24,18 @@ module OpenVidu
|
|
24
24
|
).execute
|
25
25
|
end
|
26
26
|
|
27
|
+
def self.exists?(id)
|
28
|
+
begin
|
29
|
+
OpenVidu::Command.new(
|
30
|
+
:session, :get, "api/sessions/#{id}"
|
31
|
+
).execute
|
32
|
+
true
|
33
|
+
rescue OpenVidu::ResponseError => e
|
34
|
+
raise e unless e.response.code == 404
|
35
|
+
false
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
27
39
|
def create
|
28
40
|
OpenVidu::Command.new(
|
29
41
|
:session, :post, 'api/sessions', create_params
|
data/lib/open_vidu/version.rb
CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
37
37
|
spec.add_development_dependency 'rake', '~> 10.0'
|
38
38
|
spec.add_development_dependency 'test-unit', '~> 3.3', '>= 3.3.4'
|
39
|
+
spec.add_development_dependency 'openssl', '>= 2.1.2' # Fix for Travis CI
|
39
40
|
|
40
41
|
spec.add_development_dependency 'dotenv', '~> 2.7', '>= 2.7.5'
|
41
42
|
spec.add_runtime_dependency 'httparty', '>= 0.13'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openvidu-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Saxon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -78,6 +78,20 @@ dependencies:
|
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 3.3.4
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: openssl
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 2.1.2
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 2.1.2
|
81
95
|
- !ruby/object:Gem::Dependency
|
82
96
|
name: dotenv
|
83
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,6 +147,7 @@ files:
|
|
133
147
|
- lib/open_vidu/base.rb
|
134
148
|
- lib/open_vidu/command.rb
|
135
149
|
- lib/open_vidu/config.rb
|
150
|
+
- lib/open_vidu/exceptions.rb
|
136
151
|
- lib/open_vidu/recording.rb
|
137
152
|
- lib/open_vidu/requestor.rb
|
138
153
|
- lib/open_vidu/responder.rb
|