Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
puts "Started merb_init.rb ..."
require 'active_record'
ActiveRecord::Base.verification_timeout = 14400
ActiveRecord::Base.logger = MERB_LOGGER

puts "Loading Gems (before framework) ..."
Merb::Gems.load_required(:before)

$LOAD_PATH.unshift(File.join(MERB_ROOT, "lib"))

puts "Loading Application..."
MERB_PATHS.each do |glob|
  Dir[MERB_ROOT + glob].each { |m| require m }
end

puts "Loading Gems (after framework) ..."
Merb::Gems.load_required(:after)

#Get Database Config
puts "Connecting to database..."
conn_options = YAML::load(Erubis::Eruby.new(IO.read("#{MERB_ROOT}/config/database.yml")).result(binding))
ActiveRecord::Base.establish_connection conn_options["#{MERB_ENV}"] 

#Get Environment File
require "#{MERB_ROOT}/config/environments/#{MERB_ENV}"

# 
# Add your own ruby code here for app specific stuff. This file gets loaded
# after the framework is loaded.