From 8d52d97293168c5478bd21bf0217915e89a0dbd8 Mon Sep 17 00:00:00 2001 From: Coleman Date: Sat, 22 Nov 2008 23:40:58 -0600 Subject: [PATCH] for some reason i have to explicitly require yaml --- config/init.rb | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/config/init.rb b/config/init.rb index cdc953f..dce6502 100644 --- a/config/init.rb +++ b/config/init.rb @@ -2,6 +2,7 @@ Gem.clear_paths Gem.path.unshift(Merb.root / "gems") $LOAD_PATH.unshift(Merb.root / "lib") +require 'yaml' dependencies 'haml', 'merb_helpers', 'merb_has_flash', 'merb-mailer' require 'digest/sha1' require 'sass' @@ -12,13 +13,19 @@ require 'memcache' require 'memcache_util' require 'gchart' +use_orm :activerecord +use_test :rspec +use_template_engine :haml +Merb::Config.use do |c| + c[:session_secret_key] = 'ccf75249b0efbdb3edff96d0a1b16b19cf91f31e' + c[:session_store] = :activerecord + c[:sass] ||= {} + c[:sass][:style] = :compact +end + Merb::BootLoader.after_app_loads do config_path = File.join(Merb.root, 'config', 'memcache.yml') - if File.file?(config_path) and File.readable?(config_path) - memcache_connection_str = YAML.load(File.read(config_path)) - else - memcache_connection_str = 'localhost:11211' - end + memcache_connection_str = YAML::load_file(config_path) rescue 'localhost:11211' CACHE = MemCache.new memcache_connection_str Merb::Mailer.config = { :sendmail_path => '/usr/sbin/sendmail' } @@ -33,14 +40,3 @@ Merb::BootLoader.after_app_loads do raise "ReCaptcha configuration file not found!" end end - -use_orm :activerecord -use_test :rspec -use_template_engine :haml -Merb::Config.use do |c| - c[:session_secret_key] = 'ccf75249b0efbdb3edff96d0a1b16b19cf91f31e' - c[:session_store] = :activerecord - c[:sass] ||= {} - c[:sass][:style] = :compact -end -