Use correct idiom for undefind module

This commit is contained in:
Eric Allen 2010-01-12 17:30:51 -08:00
parent 07dd842525
commit f33b747422
2 changed files with 2 additions and 2 deletions

View file

@ -10,7 +10,7 @@ class LoginController < ApplicationController
# This will allow the user to view the index page without authentication
# but will process CAS authentication data if the user already
# has an SSO session open.
if (CASClient rescue nil)
if defined? CASClient
# Only require sub-library if gem is installed and loaded
require 'casclient/frameworks/rails/filter'
before_filter CASClient::Frameworks::Rails::GatewayFilter, :only => :login_cas

View file

@ -104,7 +104,7 @@ end
if ( SITE_CONFIG['authentication_schemes'].include? 'cas')
#requires rubycas-client gem to be installed
if (CASClient rescue nil)
if defined? CASClient
require 'casclient/frameworks/rails/filter'
CASClient::Frameworks::Rails::Filter.configure(
:cas_base_url => SITE_CONFIG['cas_server'] ,