module Cloud class Settings @cloud = nil class << self def cloud_enabled? retval = !cloud_settings.empty? && !cloud_settings[:disabled] # puts "CLOUD SETTINGS NOT TESTABLE YET in #{ENV['RACK_ENV']}" if retval retval end def cloud_settings return @cloud ||= init_cloud_settings end private def init_cloud_settings cloud_settings_file = ENV['CLOUD_SETTINGS'] || './config/hws_cloud_settings.conf' # is there one? return OpenStruct.new({:disabled => true}) if !File.exist?(cloud_settings_file) # get it OpenStruct.new(YAML.load_file(cloud_settings_file))[ENV['RACK_ENV']] end end end end