Sha256: 43032b1e2e03cf11a9c15e6f0b35dd1140c79b36cebf612444636583a5132918

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

# This line just let's us require anything in the +lib+ sub-folder
# without specifying a full path.
$LOAD_PATH.unshift(File.dirname(__FILE__))

# Require the basics...
require 'set'
require 'fastthread'
require 'data_mapper/support/blank'
require 'data_mapper/support/enumerable'
require 'data_mapper/support/symbol'
require 'data_mapper/support/string'
require 'data_mapper/support/proc'
require 'data_mapper/support/inflector'
require 'data_mapper/support/struct'
require 'data_mapper/database'
require 'data_mapper/base'

# This block of code is for compatibility with Ruby On Rails' database.yml
# file, allowing you to simply require the data_mapper.rb in your
# Rails application's environment.rb to configure the DataMapper.
if defined? RAILS_ENV
  require 'yaml'
  
  rails_config = YAML::load_file(RAILS_ROOT + '/config/database.yml')
  current_config = rails_config[RAILS_ENV.to_s]

  DataMapper::Database.setup do
    adapter   current_config['adapter']
    host      current_config['host']
    database  current_config['database']
    username  current_config['username']
    password  current_config['password']
    cache WeakHash::Factory
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datamapper-0.1.1 lib/data_mapper.rb