= BigBlueButton on Rails {Travis CI Status}[http://travis-ci.org/#!/mconf/bigbluebutton_rails] {BigBlueButton}[http://bigbluebutton.org] integration for Ruby on Rails 3. Features: * Allows multiple servers and multiple conference rooms. * Full API access using {bigbluebutton-api-ruby}[https://github.com/mconf/bigbluebutton-api-ruby]. * Easy way to join conferences: simply create a room and call the "join" action. * Easy integration with authentication and authorization mechanisms, such as Devise and CanCan. * Possibility to create private rooms, that require a password to join. * Deals with visitors (users that are not logged), allowing (or forbidding) them to join rooms. * Random meeting IDs to avoid problems with end_meeting, timeouts and reuse of URLs. * Server activity monitor. * "On-the-fly" server selection when a meeting is started. Possible future features: * Limit the number of users per room and rooms per server. * Server administration (modify config.xml, use bbb-conf, etc.). * Load balancing. For more future features and issues check {our google code page}[http://code.google.com/p/mconf/issues/list?can=2&q=label%3AComponent%20label%3ABigBlueButtonRails]. == Supported BigBlueButton versions The current version of this gem supports *all* the following versions of BigBlueButton: * 0.8: Currently in the beta3 stage. It can be used with BBB 0.8 but not all features are supported yet, such as pre-upload of slides and anything related to recordings. See {TODO_08}[https://github.com/mconf/bigbluebutton_rails/blob/api-0.8/TODO_08]. * 0.7: Including 0.7, 0.71 and 0.71a. == Supported ruby versions Tested in rubies: * ruby-1.8.7 * ruby-1.9.2 * ree-1.8.7 == Installation You can install the latest version of BigbluebuttonRails using RubyGems: gem install bigbluebutton_rails Or simply add the following line in your Gemfile: gem "bigbluebutton_rails" After installing, you need to run the generator: rails generate bigbluebutton_rails:install This generator will create a migration file, a language file and some additional resources. These additional files are basically the JQuery library, a stylesheet and some images. They are only used in the *views* provided by this gem, so you may or may not use them. You can easily generate the views and modify them to use other resources. To now more about the generators see {How to: Generators}[https://github.com/mconf/bigbluebutton_rails/wiki/How-to:-Generators] === Routes The routes to BigbluebuttonRails can be generated with the helper bigbluebutton_routes. See the example below: bigbluebutton_routes :default It will generate the default routes. You need to call it at least once and the routes will be scoped with 'bigbluebutton'. They will look like: /bigbluebutton/servers /bigbluebutton/servers/my-server/new /bigbluebutton/servers/my-server/rooms /bigbluebutton/rooms /bigbluebutton/rooms/my-room/join You can customize the scope name and also make the routes use custom controllers. bigbluebutton_routes :default, :scope => 'webconference', :controllers => { :servers => 'custom_servers', :rooms => 'custom_rooms' } bigbluebutton_routes :default, :scope => '' # to remove the scope You may also want shorter routes to access conference rooms. For that, use the option room_matchers: resources :users do bigbluebutton_routes :room_matchers end It creates routes to the actions used to access a conference room, so you can allow access to webconference rooms using URLs such as: http://myserver.com/my-community/room-name/join http://myserver.com/user-name/room-name/join For more information see: * {How to: Routes}[https://github.com/mconf/bigbluebutton_rails/wiki/How-to:-Routes] === Basic configurations There are some basic assumptions made by BigbluebuttonRails: * You have a method called current_user that returns the current user; * The current_user has an attribute or method called "name" that returns his/her fullname. If you don't, you can change this behaviour easily, keep reading. BigbluebuttonRails uses the methods bigbluebutton_user and bigbluebutton_role(room) to get the current user and to get the permission that the current user has in the room, respectively. These methods are defined in {lib/bigbluebutton_rails/controller_methods.rb}[https://github.com/mconf/bigbluebutton_rails/blob/master/lib/bigbluebutton_rails/controller_methods.rb] and you can reimplement them in your application controller to change their behaviour as shown below. class ApplicationController < ActionController::Base # overriding bigbluebutton_rails function def bigbluebutton_user current_user && current_user.is_a?(User) ? current_user : nil end def bigbluebutton_role(room) ... end end ==== See also * {How to: Integrate with Devise}[https://github.com/mconf/bigbluebutton_rails/wiki/How-to:-Integrate-with-Devise] * {How to: Integrate with CanCan}[https://github.com/mconf/bigbluebutton_rails/wiki/How-to:-Integrate-with-CanCan] == Contributing/Development Fork this repository, clone your fork and start by installing the dependencies: bundle install Save spec/rails_app/features/config.yml.example as config.yml and edit it to set values for an existent BigBlueButton server. You will need it to run the integration tests. For more information see the page {Testing}[https://github.com/mconf/bigbluebutton_rails/wiki/Testing] in our wiki. Prepare the rails_app used for tests: rake setup:rails_app rake setup:rails_app:db SERVER=my-server # select a server you defined in 'config.yml' Run the tests: rake spec rake cucumber SERVER=my-server Or simply: rake SERVER=my-server Note: If you don't set the SERVER variable, the first server in config.yml will be used. Develop. :) If you want your code to be integrated in this repository, please fork it, create a branch with your modifications and submit a pull request. === Test Coverage Coverage is analyzed by default when you run: rake spec Run it and look at the file coverage/index.html. === Best Practices We use the gem rails_best_practices to get some nice tips on how to improve the code. Run: rake best_practices And look at the file rails_best_practices_output.html to see the tips.