Sha256: 8ebf5a952b3193fcc879abacaaf1b005b38601c93a87f59b35c779a98a2481d2

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

require File.join(File.dirname(__FILE__), 'boot')

# set_load_path
load_paths = %w(app app/models config vendor).collect {|dir| "#{APP_ROOT}/#{dir}"}
load_paths.reverse_each {|dir| $LOAD_PATH.unshift("#{APP_ROOT}/#{dir}") if File.directory?(dir)}
$LOAD_PATH.uniq!

# set_autoload_paths
Dependencies.load_paths = load_paths

# load_environment
APP_ENV = ENV['DB']

# initialize_database
ActiveRecord::Base.configurations = YAML::load(IO.read("#{APP_ROOT}/config/database.yml"))
ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[APP_ENV])

# initializer_logger
log_path = "#{APP_ROOT}/log/#{APP_ENV}.log"
begin
  logger = Logger.new(log_path)
  logger.level = Logger::DEBUG
rescue StandardError
  logger = Logger.new(STDERR)
  logger.level = Logger::WARN
  logger.warn(
    "Logger Error: Unable to access log file. Please ensure that #{log_path} exists and is chmod 0666. " +
    "The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
  )
end

# initialize_framework_logging
ActiveRecord::Base.logger = logger

# initialize_dependency_mechanism
Dependencies.mechanism = :require

# initialize_breakpoints
require 'active_support/breakpoint'

# initialize_whiny_nils
# require('active_support/whiny_nil')

# load_observers
ActiveRecord::Base.instantiate_observers

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polymorphic_identity-0.0.1 test/app_root/config/environment.rb