bigbluebutton_rails 1.4.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +1 -1
- data/.travis.yml +10 -1
- data/CHANGELOG.md +259 -0
- data/Gemfile +14 -19
- data/Gemfile.lock +194 -188
- data/README.md +416 -0
- data/Rakefile +12 -12
- data/TODO.md +13 -0
- data/app/controllers/bigbluebutton/playback_types_controller.rb +44 -0
- data/app/controllers/bigbluebutton/recordings_controller.rb +17 -10
- data/app/controllers/bigbluebutton/rooms_controller.rb +65 -36
- data/app/controllers/bigbluebutton/servers_controller.rb +12 -8
- data/app/models/bigbluebutton_metadata.rb +1 -1
- data/app/models/bigbluebutton_playback_format.rb +22 -1
- data/app/models/bigbluebutton_playback_type.rb +29 -0
- data/app/models/bigbluebutton_recording.rb +38 -19
- data/app/models/bigbluebutton_room.rb +150 -73
- data/app/models/bigbluebutton_room_options.rb +10 -7
- data/app/models/bigbluebutton_server.rb +69 -13
- data/app/models/bigbluebutton_server_config.rb +49 -0
- data/app/views/bigbluebutton/recordings/_form.html.erb +4 -0
- data/app/views/bigbluebutton/recordings/_recordings.html.erb +10 -3
- data/app/views/bigbluebutton/rooms/_form.html.erb +18 -6
- data/app/views/bigbluebutton/rooms/_rooms.html.erb +6 -3
- data/app/views/bigbluebutton/rooms/invite.html.erb +5 -5
- data/app/views/bigbluebutton/rooms/show.html.erb +18 -6
- data/app/views/bigbluebutton/servers/_form.html.erb +1 -1
- data/app/views/bigbluebutton/servers/show.html.erb +5 -0
- data/app/workers/bigbluebutton_finish_meetings.rb +11 -0
- data/app/workers/bigbluebutton_update_recordings.rb +11 -0
- data/app/workers/bigbluebutton_update_server_configs.rb +18 -0
- data/bigbluebutton_rails.gemspec +8 -7
- data/config/locales/en.yml +52 -7
- data/config/locales/pt-br.yml +162 -0
- data/config/resque/resque.rake +27 -0
- data/config/resque/workers_schedule.yml +17 -0
- data/lib/bigbluebutton_rails.rb +30 -2
- data/lib/bigbluebutton_rails/background_tasks.rb +31 -0
- data/lib/bigbluebutton_rails/controller_methods.rb +12 -8
- data/lib/bigbluebutton_rails/dial_number.rb +48 -0
- data/lib/bigbluebutton_rails/rails/routes.rb +9 -2
- data/lib/bigbluebutton_rails/utils.rb +9 -2
- data/lib/bigbluebutton_rails/version.rb +1 -1
- data/lib/generators/bigbluebutton_rails/install_generator.rb +0 -8
- data/lib/generators/bigbluebutton_rails/templates/migration.rb +28 -6
- data/lib/generators/bigbluebutton_rails/templates/migration_2_0_0.rb +56 -0
- data/lib/tasks/bigbluebutton_rails/meetings.rake +1 -13
- data/lib/tasks/bigbluebutton_rails/recordings.rake +1 -12
- data/lib/tasks/bigbluebutton_rails/server_configs.rake +10 -0
- data/spec/bigbluebutton_rails_spec.rb +0 -13
- data/spec/controllers/bigbluebutton/playback_types_controller_spec.rb +76 -0
- data/spec/controllers/bigbluebutton/recordings_controller_spec.rb +109 -37
- data/spec/controllers/bigbluebutton/rooms_controller_exception_handling_spec.rb +1 -0
- data/spec/controllers/bigbluebutton/rooms_controller_json_responses_spec.rb +27 -3
- data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +338 -77
- data/spec/controllers/bigbluebutton/servers_controller_json_responses_spec.rb +8 -0
- data/spec/controllers/bigbluebutton/servers_controller_spec.rb +182 -47
- data/spec/factories/bigbluebutton_meeting.rb +2 -2
- data/spec/factories/bigbluebutton_playback_format.rb +2 -2
- data/spec/factories/bigbluebutton_playback_type.rb +7 -0
- data/spec/factories/bigbluebutton_recording.rb +8 -0
- data/spec/factories/bigbluebutton_room.rb +10 -3
- data/spec/factories/bigbluebutton_server.rb +6 -1
- data/spec/factories/bigbluebutton_server_config.rb +6 -0
- data/spec/generators/install_generator_spec.rb +0 -16
- data/spec/lib/bigbluebutton_rails/background_tasks_spec.rb +61 -0
- data/spec/lib/bigbluebutton_rails/dial_number_spec.rb +78 -0
- data/spec/lib/bigbluebutton_rails/utils_spec.rb +56 -0
- data/spec/lib/tasks/meetings_rake_spec.rb +14 -1
- data/spec/lib/tasks/recordings_rake_spec.rb +14 -1
- data/spec/models/bigbluebutton_meeting_db_spec.rb +3 -3
- data/spec/models/bigbluebutton_meeting_spec.rb +4 -4
- data/spec/models/bigbluebutton_playback_format_db_spec.rb +0 -1
- data/spec/models/bigbluebutton_playback_format_spec.rb +75 -4
- data/spec/models/bigbluebutton_playback_type_db_spec.rb +14 -0
- data/spec/models/bigbluebutton_playback_type_spec.rb +76 -0
- data/spec/models/bigbluebutton_recording_db_spec.rb +3 -1
- data/spec/models/bigbluebutton_recording_spec.rb +234 -58
- data/spec/models/bigbluebutton_room_db_spec.rb +8 -6
- data/spec/models/bigbluebutton_room_options_db_spec.rb +1 -0
- data/spec/models/bigbluebutton_room_options_spec.rb +137 -38
- data/spec/models/bigbluebutton_room_spec.rb +540 -153
- data/spec/models/bigbluebutton_server_config_spec.rb +115 -0
- data/spec/models/bigbluebutton_server_spec.rb +180 -23
- data/spec/rails_app/app/controllers/my_playback_types_controller.rb +7 -0
- data/spec/rails_app/app/views/frontpage/show.html.erb +1 -0
- data/spec/rails_app/app/views/my_playback_types/index.html.erb +33 -0
- data/spec/rails_app/config/application.rb +0 -3
- data/spec/rails_app/config/database.yml.travis +10 -0
- data/spec/rails_app/config/environments/development.rb +1 -6
- data/spec/rails_app/config/environments/production.rb +2 -0
- data/spec/rails_app/config/environments/test.rb +2 -0
- data/spec/rails_app/config/routes.rb +5 -2
- data/spec/rails_app/db/seeds.rb +1 -1
- data/spec/rails_app/features/config.yml.example +3 -4
- data/spec/rails_app/features/join_rooms.feature +14 -14
- data/spec/rails_app/features/step_definitions/activity_monitor_servers_step.rb +2 -2
- data/spec/rails_app/features/step_definitions/create_rooms_steps.rb +4 -4
- data/spec/rails_app/features/step_definitions/destroy_rooms_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/join_rooms_steps.rb +10 -10
- data/spec/rails_app/features/step_definitions/web_steps.rb +2 -2
- data/spec/rails_app/features/support/configurations.rb +1 -1
- data/spec/rails_app/features/support/templates.rb +12 -12
- data/spec/rails_app/lib/tasks/db/populate.rake +19 -6
- data/spec/routing/bigbluebutton/custom_controllers_routing_spec.rb +1 -1
- data/spec/routing/bigbluebutton/recordings_only_routing_spec.rb +2 -2
- data/spec/routing/bigbluebutton/recordings_routing_spec.rb +2 -2
- data/spec/routing/bigbluebutton/rooms_only_routing_spec.rb +1 -1
- data/spec/routing/bigbluebutton/rooms_routing_spec.rb +15 -1
- data/spec/routing/bigbluebutton/servers_only_routing_spec.rb +1 -1
- data/spec/routing/bigbluebutton/servers_routing_spec.rb +1 -1
- data/spec/spec_helper.rb +23 -31
- data/spec/support/matchers/delegate_matcher.rb +8 -1
- data/spec/support/matchers/shoulda/respond_with_json_matcher.rb +2 -2
- data/spec/support/mocked_server.rb +2 -0
- data/spec/support/shared_contexts/rake.rb +23 -0
- data/spec/workers/bigbluebutton_finish_meetings_spec.rb +14 -0
- data/spec/workers/bigbluebutton_update_recordings_spec.rb +14 -0
- data/spec/workers/bigbluebutton_update_server_configs_spec.rb +47 -0
- metadata +70 -59
- data/CHANGELOG.rdoc +0 -111
- data/README.rdoc +0 -319
- data/TODO.rdoc +0 -16
- data/config/schedule.rb +0 -7
@@ -0,0 +1,31 @@
|
|
1
|
+
module BigbluebuttonRails
|
2
|
+
|
3
|
+
# Helper methods to execute tasks that run in resque and rake.
|
4
|
+
class BackgroundTasks
|
5
|
+
|
6
|
+
def self.finish_meetings
|
7
|
+
BigbluebuttonMeeting.where(running: true).find_each do |meeting|
|
8
|
+
Rails.logger.info "BackgroundTasks: Checking if the meeting has ended: #{meeting.inspect}"
|
9
|
+
if meeting.room and !meeting.room.fetch_is_running?
|
10
|
+
Rails.logger.info "BackgroundTasks: Setting meeting as ended: #{meeting.inspect}"
|
11
|
+
meeting.update_attributes(running: false)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.update_recordings
|
17
|
+
BigbluebuttonServer.find_each do |server|
|
18
|
+
begin
|
19
|
+
server.fetch_recordings
|
20
|
+
Rails.logger.info "BackgroundTasks: List of recordings from #{server.url} updated successfully"
|
21
|
+
rescue Exception => e
|
22
|
+
Rails.logger.info "BackgroundTasks: Failure fetching recordings from #{server.inspect}"
|
23
|
+
Rails.logger.info "BackgroundTasks: #{e.inspect}"
|
24
|
+
Rails.logger.info "BackgroundTasks: #{e.backtrace.join("\n")}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -29,12 +29,12 @@ module BigbluebuttonRails
|
|
29
29
|
# Returns the role that the current user has in the room 'room'. Return values:
|
30
30
|
# :moderator # the user has attendee permissions
|
31
31
|
# :attendee # the user has moderator permissions
|
32
|
-
# :
|
32
|
+
# :key # the user must enter a key that will define his role
|
33
33
|
# nil # no role at all (the room is blocked to this user)
|
34
34
|
#
|
35
35
|
# Returning :moderator or :attendee means that the current user has access
|
36
36
|
# to the room and has moderator or attendee privileges, respectively.
|
37
|
-
# Returning :
|
37
|
+
# Returning :key indicates that the user must enter a key to define
|
38
38
|
# his role in the room.
|
39
39
|
# At last, returning nil means that the user cannot access access this room
|
40
40
|
# at all. BigbluebuttonRails::RoomController will thrown an exception of the
|
@@ -51,7 +51,7 @@ module BigbluebuttonRails
|
|
51
51
|
# You may want to redefine this method in your application to define
|
52
52
|
# real roles to the users. By default, if the room is not private and the user
|
53
53
|
# is logged, he will have moderator permissions. Otherwise, he must enter
|
54
|
-
# a
|
54
|
+
# a key. Redefine it in your ApplicationController to make it available
|
55
55
|
# to all controllers. For example:
|
56
56
|
#
|
57
57
|
# def bigbluebutton_role(@room)
|
@@ -63,7 +63,7 @@ module BigbluebuttonRails
|
|
63
63
|
# # only friends are allowed to enter
|
64
64
|
# elsif @room.owner.friends.include? bigbluebutton_user
|
65
65
|
# if @room.private
|
66
|
-
# :
|
66
|
+
# :key # with key if the room is private
|
67
67
|
# else
|
68
68
|
# :attendee
|
69
69
|
# end
|
@@ -77,7 +77,7 @@ module BigbluebuttonRails
|
|
77
77
|
#
|
78
78
|
def bigbluebutton_role(room)
|
79
79
|
if room.private or bigbluebutton_user.nil?
|
80
|
-
:
|
80
|
+
:key # ask for a key
|
81
81
|
else
|
82
82
|
:moderator
|
83
83
|
end
|
@@ -107,18 +107,22 @@ module BigbluebuttonRails
|
|
107
107
|
end
|
108
108
|
|
109
109
|
# Method called right before a meeting is created to get options that should receive
|
110
|
-
# priority over the options saved in the database when sending the <tt>create</tt>
|
111
|
-
# call.
|
110
|
+
# priority over the options saved in the database when sending the <tt>create</tt>
|
111
|
+
# API call.
|
112
112
|
# The parameter 'room' is the BigbluebuttonRoom where the meeting is about
|
113
113
|
# to be created.
|
114
114
|
#
|
115
|
-
# By default, all options
|
115
|
+
# By default, all options sent in a 'create' API call are taken from the
|
116
116
|
# options saved in the database for the target room. This includes, for example,
|
117
117
|
# the meeting's name, dial number, welcome message, if it should be recorded or not.
|
118
118
|
# This method can return a hash of options to force some of these options to be
|
119
119
|
# different from what is stored in the database. For example, if a room should *not* be
|
120
120
|
# recorded in case unprivileged users create it, this method can return <tt>{ record: false }</tt>
|
121
121
|
# to force the <tt>record</tt> flag to be false.
|
122
|
+
# The keys used in this hash should correspond to the attributes sent in the <tt>CREATE</tt>
|
123
|
+
# API call, not the the attributes stored in the database! See the method
|
124
|
+
# <tt>create_meeting</tt> in the gem <tt>bigbluebutton-api-ruby</tt> for examples.
|
125
|
+
# (https://github.com/mconf/bigbluebutton-api-ruby/blob/master/lib/bigbluebutton_api.rb#L156)
|
122
126
|
#
|
123
127
|
# You may want to override this in your ApplicationController to implement your own
|
124
128
|
# own logic, if needed. For example:
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module BigbluebuttonRails
|
2
|
+
class DialNumber
|
3
|
+
|
4
|
+
# Generates a random dial number based on the `pattern` (e.g. '123x-xxxx')
|
5
|
+
def self.randomize(pattern=nil, opt={})
|
6
|
+
return nil if pattern.nil?
|
7
|
+
sym = get_symbol(opt)
|
8
|
+
size = pattern.count(sym)
|
9
|
+
|
10
|
+
# e.g. random from 0 to 999 if the pattern has 3 x's
|
11
|
+
num = SecureRandom.random_number((10 ** size) - 1)
|
12
|
+
|
13
|
+
get_dial_number_from_ordinal(num, pattern, opt)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.get_dial_number_from_ordinal(ordinal, pattern=nil, opt={})
|
17
|
+
return nil if pattern.nil?
|
18
|
+
sym = get_symbol(opt)
|
19
|
+
|
20
|
+
number_size = pattern.count(sym)
|
21
|
+
ordinal_str = ordinal.to_s.rjust(number_size,'0').reverse
|
22
|
+
dial_number = pattern.reverse
|
23
|
+
|
24
|
+
ordinal_str.each_char do |n|
|
25
|
+
dial_number.sub!(sym, n)
|
26
|
+
end
|
27
|
+
|
28
|
+
dial_number.reverse
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.get_ordinal_from_dial_number(number, pattern=nil, opt={})
|
32
|
+
return nil if pattern.nil?
|
33
|
+
sym = get_symbol(opt)
|
34
|
+
|
35
|
+
regexp = Regexp.new(pattern.gsub(sym, '([0-9])')) # make a pattern to capture only the numbers
|
36
|
+
match = regexp.match(number) # extract only the numbers
|
37
|
+
|
38
|
+
# join the numbers and turn then into an ordinal integer
|
39
|
+
ordinal = match[1, match.size].join.to_i if match.present?
|
40
|
+
|
41
|
+
ordinal
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.get_symbol opt
|
45
|
+
opt[:symbol] || 'x'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -43,7 +43,8 @@ module ActionDispatch::Routing
|
|
43
43
|
# bigbluebutton_routes :default,
|
44
44
|
# :controllers => { :servers => "custom_servers",
|
45
45
|
# :rooms => "custom_rooms",
|
46
|
-
# :recordings => "custom_recordings"
|
46
|
+
# :recordings => "custom_recordings",
|
47
|
+
# :playback_types => "custom_playback_types }
|
47
48
|
#
|
48
49
|
# ==== Room matchers
|
49
50
|
#
|
@@ -84,13 +85,14 @@ module ActionDispatch::Routing
|
|
84
85
|
options = params.extract_options!
|
85
86
|
options_scope = options.has_key?(:scope) ? options[:scope] : BigbluebuttonRails.routing_scope
|
86
87
|
options_as = options.has_key?(:as) ? options[:as] : options_scope
|
87
|
-
options_only = options.has_key?(:only) ? options[:only] : ["servers", "rooms", "recordings"]
|
88
|
+
options_only = options.has_key?(:only) ? options[:only] : ["servers", "rooms", "recordings", "playback_types"]
|
88
89
|
BigbluebuttonRails.set_controllers(options[:controllers])
|
89
90
|
|
90
91
|
scope options_scope, :as => options_as do
|
91
92
|
add_routes_for_servers if options_only.include?("servers")
|
92
93
|
add_routes_for_rooms if options_only.include?("rooms")
|
93
94
|
add_routes_for_recordings if options_only.include?("recordings")
|
95
|
+
add_routes_for_playback_types if options_only.include?("playback_types")
|
94
96
|
end
|
95
97
|
end
|
96
98
|
|
@@ -109,6 +111,7 @@ module ActionDispatch::Routing
|
|
109
111
|
post :join
|
110
112
|
post :fetch_recordings
|
111
113
|
get :recordings
|
114
|
+
post :generate_dial_number
|
112
115
|
end
|
113
116
|
end
|
114
117
|
end
|
@@ -137,5 +140,9 @@ module ActionDispatch::Routing
|
|
137
140
|
end
|
138
141
|
end
|
139
142
|
|
143
|
+
def add_routes_for_playback_types #:nodoc:
|
144
|
+
resources :playback_types, :only => [:update],
|
145
|
+
:controller => BigbluebuttonRails.controllers[:playback_types]
|
146
|
+
end
|
140
147
|
end
|
141
148
|
end
|
@@ -1,8 +1,15 @@
|
|
1
|
+
require 'browser'
|
2
|
+
|
1
3
|
module BigbluebuttonRails
|
2
4
|
|
3
|
-
#
|
5
|
+
# Returns whether the current client should use the mobile client
|
6
|
+
# or the desktop client.
|
7
|
+
def self.use_mobile_client?(browser)
|
8
|
+
browser.mobile? || browser.tablet?
|
9
|
+
end
|
10
|
+
|
11
|
+
# Just a wrapper around the Rails method to convert values to boolean
|
4
12
|
def self.value_to_boolean(value)
|
5
13
|
ActiveRecord::ConnectionAdapters::Column.value_to_boolean(value)
|
6
14
|
end
|
7
|
-
|
8
15
|
end
|
@@ -26,14 +26,6 @@ module BigbluebuttonRails
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def create_schedule
|
30
|
-
unless options.migration_only?
|
31
|
-
create_file 'config/schedule.rb'
|
32
|
-
content = File.read(File.expand_path("../../../../config/schedule.rb", __FILE__))
|
33
|
-
append_file 'config/schedule.rb', "\n#{content}" unless behavior == :revoke
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
29
|
protected
|
38
30
|
|
39
31
|
def migration_path
|
@@ -16,8 +16,8 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
16
16
|
t.string :owner_type
|
17
17
|
t.string :meetingid
|
18
18
|
t.string :name
|
19
|
-
t.string :
|
20
|
-
t.string :
|
19
|
+
t.string :attendee_key
|
20
|
+
t.string :moderator_key
|
21
21
|
t.string :welcome_msg
|
22
22
|
t.string :logout_url
|
23
23
|
t.string :voice_bridge
|
@@ -26,13 +26,18 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
26
26
|
t.boolean :private, :default => false
|
27
27
|
t.boolean :external, :default => false
|
28
28
|
t.string :param
|
29
|
-
t.boolean :
|
29
|
+
t.boolean :record_meeting, :default => false
|
30
30
|
t.integer :duration, :default => 0
|
31
|
+
t.string :attendee_api_password
|
32
|
+
t.string :moderator_api_password
|
33
|
+
t.decimal :create_time, precision: 14, scale: 0
|
34
|
+
t.string :moderator_only_message
|
35
|
+
t.boolean :auto_start_recording, default: false
|
36
|
+
t.boolean :allow_start_stop_recording, default: true
|
31
37
|
t.timestamps
|
32
38
|
end
|
33
39
|
add_index :bigbluebutton_rooms, :server_id
|
34
40
|
add_index :bigbluebutton_rooms, :meetingid, :unique => true
|
35
|
-
add_index :bigbluebutton_rooms, :voice_bridge, :unique => true
|
36
41
|
|
37
42
|
create_table :bigbluebutton_room_options do |t|
|
38
43
|
t.integer :room_id
|
@@ -40,6 +45,7 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
40
45
|
t.boolean :presenter_share_only
|
41
46
|
t.boolean :auto_start_video
|
42
47
|
t.boolean :auto_start_audio
|
48
|
+
t.string :background
|
43
49
|
t.timestamps
|
44
50
|
end
|
45
51
|
add_index :bigbluebutton_room_options, :room_id
|
@@ -56,6 +62,7 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
56
62
|
t.datetime :end_time
|
57
63
|
t.boolean :available, :default => true
|
58
64
|
t.string :description
|
65
|
+
t.integer :size, limit: 8, default: 0
|
59
66
|
t.timestamps
|
60
67
|
end
|
61
68
|
add_index :bigbluebutton_recordings, :room_id
|
@@ -71,12 +78,19 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
71
78
|
|
72
79
|
create_table :bigbluebutton_playback_formats do |t|
|
73
80
|
t.integer :recording_id
|
74
|
-
t.
|
81
|
+
t.integer :playback_type_id
|
75
82
|
t.string :url
|
76
83
|
t.integer :length
|
77
84
|
t.timestamps
|
78
85
|
end
|
79
86
|
|
87
|
+
create_table :bigbluebutton_playback_types do |t|
|
88
|
+
t.string :identifier
|
89
|
+
t.boolean :visible, :default => false
|
90
|
+
t.boolean :default, :default => false
|
91
|
+
t.timestamps
|
92
|
+
end
|
93
|
+
|
80
94
|
create_table :bigbluebutton_meetings do |t|
|
81
95
|
t.integer :server_id
|
82
96
|
t.integer :room_id
|
@@ -84,22 +98,30 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
84
98
|
t.string :name
|
85
99
|
t.datetime :start_time
|
86
100
|
t.boolean :running, :default => false
|
87
|
-
t.boolean :
|
101
|
+
t.boolean :recorded, :default => false
|
88
102
|
t.integer :creator_id
|
89
103
|
t.string :creator_name
|
90
104
|
t.timestamps
|
91
105
|
end
|
92
106
|
add_index :bigbluebutton_meetings, [:meetingid, :start_time], :unique => true
|
107
|
+
|
108
|
+
create_table :bigbluebutton_server_configs do |t|
|
109
|
+
t.integer :server_id
|
110
|
+
t.text :available_layouts
|
111
|
+
t.timestamps
|
112
|
+
end
|
93
113
|
end
|
94
114
|
|
95
115
|
def self.down
|
96
116
|
drop_table :bigbluebutton_meetings
|
97
117
|
drop_table :bigbluebutton_playback_formats
|
118
|
+
drop_table :bigbluebutton_playback_types
|
98
119
|
drop_table :bigbluebutton_metadata
|
99
120
|
drop_table :bigbluebutton_recordings
|
100
121
|
drop_table :bigbluebutton_rooms
|
101
122
|
drop_table :bigbluebutton_rooms_options
|
102
123
|
drop_table :bigbluebutton_servers
|
124
|
+
drop_table :bigbluebutton_server_configs
|
103
125
|
end
|
104
126
|
|
105
127
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
class BigbluebuttonRailsTo200 < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
create_table :bigbluebutton_playback_types do |t|
|
5
|
+
t.string :identifier
|
6
|
+
t.boolean :visible, default: false
|
7
|
+
t.boolean :default, default: false
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
rename_column :bigbluebutton_rooms, :record, :record_meeting
|
12
|
+
rename_column :bigbluebutton_meetings, :record, :recorded
|
13
|
+
rename_column :bigbluebutton_rooms, :attendee_password, :attendee_key
|
14
|
+
rename_column :bigbluebutton_rooms, :moderator_password, :moderator_key
|
15
|
+
add_column :bigbluebutton_rooms, :moderator_api_password, :string
|
16
|
+
add_column :bigbluebutton_rooms, :attendee_api_password, :string
|
17
|
+
add_column :bigbluebutton_rooms, :create_time, :decimal, precision: 14, scale: 0
|
18
|
+
remove_column :bigbluebutton_playback_formats, :format_type
|
19
|
+
add_column :bigbluebutton_playback_formats, :playback_type_id, :integer
|
20
|
+
remove_index :bigbluebutton_rooms, :voice_bridge
|
21
|
+
|
22
|
+
create_table :bigbluebutton_server_configs do |t|
|
23
|
+
t.integer :server_id
|
24
|
+
t.text :available_layouts
|
25
|
+
t.timestamps
|
26
|
+
end
|
27
|
+
|
28
|
+
add_column :bigbluebutton_rooms, :moderator_only_message, :string
|
29
|
+
add_column :bigbluebutton_rooms, :auto_start_recording, :boolean, default: false
|
30
|
+
add_column :bigbluebutton_rooms, :allow_start_stop_recording, :boolean, default: true
|
31
|
+
|
32
|
+
add_column :bigbluebutton_room_options, :background, :string
|
33
|
+
|
34
|
+
add_column :bigbluebutton_recordings, :size, :integer, limit: 8, default: 0
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.down
|
38
|
+
drop_table :bigbluebutton_playback_types
|
39
|
+
rename_column :bigbluebutton_rooms, :record_meeting, :record
|
40
|
+
rename_column :bigbluebutton_meetings, :recorded, :record
|
41
|
+
rename_column :bigbluebutton_rooms, :attendee_key, :attendee_password
|
42
|
+
rename_column :bigbluebutton_rooms, :moderator_key, :moderator_password
|
43
|
+
remove_column :bigbluebutton_rooms, :moderator_api_password
|
44
|
+
remove_column :bigbluebutton_rooms, :attendee_api_password
|
45
|
+
remove_column :bigbluebutton_rooms, :create_time
|
46
|
+
add_column :bigbluebutton_playback_formats, :format_type, :string
|
47
|
+
remove_column :bigbluebutton_playback_formats, :playback_type_id
|
48
|
+
add_index :bigbluebutton_rooms, :voice_bridge, :unique => true
|
49
|
+
drop_table :bigbluebutton_server_configs
|
50
|
+
remove_column :bigbluebutton_rooms, :moderator_only_message
|
51
|
+
remove_column :bigbluebutton_rooms, :auto_start_recording
|
52
|
+
remove_column :bigbluebutton_rooms, :allow_start_stop_recording
|
53
|
+
remove_column :bigbluebutton_room_options, :background
|
54
|
+
remove_column :bigbluebutton_recordings, :size, :integer
|
55
|
+
end
|
56
|
+
end
|
@@ -2,21 +2,9 @@ require 'bigbluebutton_exception'
|
|
2
2
|
|
3
3
|
namespace :bigbluebutton_rails do
|
4
4
|
namespace :meetings do
|
5
|
-
|
6
5
|
desc "Checks all meetings with running==true to see if they have finished"
|
7
6
|
task :finish => :environment do
|
8
|
-
|
9
|
-
begin
|
10
|
-
puts "[rake bigbluebutton_rails:meetings:finish] Getting meeting info for: #{meeting.inspect}"
|
11
|
-
meeting.room.fetch_meeting_info
|
12
|
-
rescue BigBlueButton::BigBlueButtonException => e
|
13
|
-
|
14
|
-
# it will fail with an exception if the meeting ended because the meetingID is not found
|
15
|
-
puts "[rake bigbluebutton_rails:meetings:finish] Setting meeting as not running: #{meeting.inspect}"
|
16
|
-
meeting.update_attributes(:running => false)
|
17
|
-
end
|
18
|
-
end
|
7
|
+
BigbluebuttonRails::BackgroundTasks.finish_meetings
|
19
8
|
end
|
20
|
-
|
21
9
|
end
|
22
10
|
end
|
@@ -1,19 +1,8 @@
|
|
1
1
|
namespace :bigbluebutton_rails do
|
2
2
|
namespace :recordings do
|
3
|
-
|
4
3
|
desc "Fetch recordings in all servers"
|
5
4
|
task :update => :environment do
|
6
|
-
|
7
|
-
begin
|
8
|
-
server.fetch_recordings
|
9
|
-
puts "[rake bigbluebutton_rails:recordings:update] List of recordings from #{server.url} updated successfully"
|
10
|
-
rescue Exception => e
|
11
|
-
puts "[rake bigbluebutton_rails:recordings:update] Failure fetching recordings from #{server.inspect}"
|
12
|
-
puts e.inspect
|
13
|
-
puts e.backtrace.join "\n"
|
14
|
-
end
|
15
|
-
end
|
5
|
+
BigbluebuttonRails::BackgroundTasks.update_recordings
|
16
6
|
end
|
17
|
-
|
18
7
|
end
|
19
8
|
end
|
@@ -8,17 +8,4 @@ describe BigbluebuttonRails do
|
|
8
8
|
it "should have be an engine" do
|
9
9
|
BigbluebuttonRails::Engine.should be < Rails::Engine
|
10
10
|
end
|
11
|
-
|
12
|
-
describe "#value_to_boolean" do
|
13
|
-
it { BigbluebuttonRails::value_to_boolean("true").should be_true }
|
14
|
-
it { BigbluebuttonRails::value_to_boolean("1").should be_true }
|
15
|
-
it { BigbluebuttonRails::value_to_boolean(1).should be_true }
|
16
|
-
it { BigbluebuttonRails::value_to_boolean(true).should be_true }
|
17
|
-
it { BigbluebuttonRails::value_to_boolean("t").should be_true }
|
18
|
-
it { BigbluebuttonRails::value_to_boolean("false").should be_false }
|
19
|
-
it { BigbluebuttonRails::value_to_boolean("0").should be_false }
|
20
|
-
it { BigbluebuttonRails::value_to_boolean(0).should be_false }
|
21
|
-
it { BigbluebuttonRails::value_to_boolean(false).should be_false }
|
22
|
-
it { BigbluebuttonRails::value_to_boolean("f").should be_false }
|
23
|
-
end
|
24
11
|
end
|