Class: BcmsCas::Engine

Inherits:
Rails::Engine
  • Object
show all
Includes:
Cms::Module
Defined in:
lib/bcms_cas/engine.rb

Constant Summary collapse

NOT_CONFIGURED =
"https://localhost:3000/cas-not-configured"

Class Method Summary collapse

Class Method Details

.cas_serverObject



33
34
35
36
37
38
39
# File 'lib/bcms_cas/engine.rb', line 33

def self.cas_server
  if Rails.configuration.respond_to? :bcms_cas_server
    Rails.configuration.bcms_cas_server
  else
    NOT_CONFIGURED
  end
end

.configured?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/bcms_cas/engine.rb', line 41

def self.configured?
  NOT_CONFIGURED != cas_server
end

.raise_configuration_errorObject



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/bcms_cas/engine.rb', line 45

def self.raise_configuration_error      
  error_message = <<message

  Configuration Issue: You must configure a CAS server for the bcms_cas module to work.
  Add the following to 'config/environments/#{Rails.env}.rb'
  
      config.bcms_cas_server = "https://cas.some-domain.com"

message
  raise error_message
end