Skip to content
Snippets Groups Projects
Unverified Commit 3124f309 authored by Hadi Cheaito's avatar Hadi Cheaito Committed by GitHub
Browse files

Setup and connect bbb_api gem (#3296)

* Setup and connect bbb_api gem

* Fixes and cleaning

* Changing api version

* Testing changes

* Test cleanup
parent 31540778
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.1.0'
gem 'bcrypt', '~> 3.1.7'
gem 'bigbluebutton-api-ruby', '1.8'
gem 'bootsnap', require: false
gem 'cssbundling-rails'
gem 'dotenv-rails'
......
......@@ -70,6 +70,14 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
bcrypt (3.1.17)
bigbluebutton-api-ruby (1.8.0)
childprocess (>= 1.0.1)
ffi (>= 1.9.24)
json (>= 1.8.6)
nokogiri (>= 1.10.4)
rack (>= 1.6.11)
rubyzip (>= 1.3.0)
xml-simple (~> 1.1)
bindex (0.8.1)
bootsnap (1.11.1)
msgpack (~> 1.2)
......@@ -105,6 +113,7 @@ GEM
railties (>= 5.0.0)
faker (2.20.0)
i18n (>= 1.8.11, < 2)
ffi (1.15.5)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.10.0)
......@@ -118,6 +127,7 @@ GEM
activesupport (>= 5.0.0)
jsbundling-rails (1.0.2)
railties (>= 6.0.0)
json (2.6.1)
loofah (2.14.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
......@@ -265,6 +275,8 @@ GEM
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xml-simple (1.1.9)
rexml
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.5.4)
......@@ -274,6 +286,7 @@ PLATFORMS
DEPENDENCIES
bcrypt (~> 3.1.7)
bigbluebutton-api-ruby (= 1.8)
bootsnap
capybara
cssbundling-rails
......
# frozen_string_literal: true
require 'bigbluebutton_api'
class BigBlueButtonApi
def initialize; end
# Sets a BigBlueButtonApi object for interacting with the API.
def bbb_server
# TODO: Hadi - Add additional logic here...
@bbb_server ||= BigBlueButton::BigBlueButtonApi.new(bbb_endpoint, bbb_secret, '1.8')
end
private
def bbb_endpoint
ENV['BIGBLUEBUTTON_ENDPOINT']
end
def bbb_secret
ENV['BIGBLUEBUTTON_SECRET']
end
end
ruby-build @ 10a56a28
Subproject commit 10a56a289c4699f076b654e94dc3d07aad3dee56
# DATABASE URL
# Must be in the format postgres://username:password@host:port
DATABASE_URL=
# The endpoint and secret for your BigBlueButton server.
# Set these if you are running GreenLight on a single BigBlueButton server.
# You can retrive these by running the following command on your BigBlueButton server:
#
# bbb-conf --secret
#
BIGBLUEBUTTON_ENDPOINT=
BIGBLUEBUTTON_SECRET=
\ No newline at end of file
# frozen_string_literal: true
require 'rails_helper'
require 'bigbluebutton_api'
describe BigBlueButtonApi, type: :service do
before do
ENV['BIGBLUEBUTTON_ENDPOINT'] = 'http://test.com/bigbluebutton/api'
ENV['BIGBLUEBUTTON_SECRET'] = 'test'
end
let(:bbb_service) { described_class.new }
describe 'Instance of BigBlueButtonApi being created' do
it 'Created an instance of BigBlueButtonApi' do
expect(BigBlueButton::BigBlueButtonApi).to receive(:new).with(ENV['BIGBLUEBUTTON_ENDPOINT'], ENV['BIGBLUEBUTTON_SECRET'], "1.8")
bbb_service.bbb_server
end
it 'BigBlueButton client initialized once per request' do
bbb_api = bbb_service.bbb_server
bbb_api2 = bbb_service.bbb_server
bbb_api3 = bbb_service.bbb_server
expect(bbb_api).to eq(bbb_api2).and eq(bbb_api3)
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment