Module: Motr::Dash

Defined in:
lib/motr/dash.rb

Overview

Motr::Dash is basically a dashboard for an entire rails app. It does things like setting up app-wide configurations etc.

Instance Method Summary collapse

Instance Method Details

#configObject

Defines an application-wide configuration hash created from config/config.yml



13
14
15
16
17
18
19
20
21
22
# File 'lib/motr/dash.rb', line 13

def config
  return @motr_application_config unless @motr_application_config.nil?
  begin
    config_data = YAML::load(File.open("#{Rails.root}/config/config.yml")) 
  rescue
    warn("Motr::Dash: Application configuration not found, please create a config.yml at #{Rails.root}/config/config.yml")
    config_data = {}
  end
  @motr_application_config = ActiveSupport::HashWithIndifferentAccess::new(config_data[Rails.env] ||= {})
end

#reconfigure!Object

Force reload of application configuration (without server restart)



27
28
29
# File 'lib/motr/dash.rb', line 27

def reconfigure!
  @motr_application_config = nil
end