Module: PhobosCheckpointUI

Defined in:
lib/phobos_checkpoint_ui.rb,
lib/phobos_checkpoint_ui/app.rb,
lib/phobos_checkpoint_ui/tasks.rb,
lib/phobos_checkpoint_ui/version.rb,
lib/phobos_checkpoint_ui/static_app.rb,
lib/phobos_checkpoint_ui/saml_handler.rb

Defined Under Namespace

Modules: App, Tasks Classes: SamlHandler, StaticApp

Constant Summary collapse

VERSION =
'2.0.0'

Class Method Summary collapse

Class Method Details

.configObject



11
12
13
# File 'lib/phobos_checkpoint_ui.rb', line 11

def config
  @config || {}
end

.configure(path = 'config/checkpoint_ui.yml') ⇒ Object



19
20
21
# File 'lib/phobos_checkpoint_ui.rb', line 19

def configure(path='config/checkpoint_ui.yml')
  @config = read_config(path)
end

.read_config(path) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/phobos_checkpoint_ui.rb', line 23

def read_config(path)
  return {} unless File.exists? path
  
  YAML.load(
    ERB.new(
      File.read(
        File.expand_path(path)
      )
    ).result
  ).deep_symbolize_keys
end

.use_saml?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/phobos_checkpoint_ui.rb', line 15

def use_saml?
  self.config.dig(:saml).present?
end