Sha256: c4d5b5dad7ec433e9aa9f16b49599d80f29d3766f6fac86b5e0c288f429f1893

Contents?: true

Size: 891 Bytes

Versions: 10

Compression:

Stored size: 891 Bytes

Contents

Dir["#{File.dirname(__FILE__)}/../vendor/*/lib"].each do |path|
  $:.unshift path
end

require 'rubygems'
gem 'activerecord', '=2.3.2'
gem 'actionmailer', '=2.3.2'
require 'activerecord'
require 'actionmailer'
require 'logger'
require 'yaml'

require File.dirname(__FILE__) + "/active_wrapper/db"
require File.dirname(__FILE__) + "/active_wrapper/log"
require File.dirname(__FILE__) + "/active_wrapper/mail"

module ActiveWrapper
  class <<self
    
    def setup(options={})
      
      options = {
        :base => File.dirname($0),
        :env => 'development',
        :log => options[:env] || 'development'
      }.merge(options.reject { |k, v| v.nil? })
      
      db = Db.new(options)
      log = Log.new(options)
      mail = Mail.new(options)
      
      ActionMailer::Base.logger = log
    
      [ db, log, mail ]
    end
  end
end

ActiveRecord::Base.default_timezone = :utc

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
winton-active_wrapper-0.1.2 lib/active_wrapper.rb
winton-active_wrapper-0.1.3 lib/active_wrapper.rb
winton-active_wrapper-0.1.4 lib/active_wrapper.rb
winton-active_wrapper-0.1.5 lib/active_wrapper.rb
winton-active_wrapper-0.1.6 lib/active_wrapper.rb
winton-active_wrapper-0.1.7 lib/active_wrapper.rb
winton-active_wrapper-0.1.8 lib/active_wrapper.rb
winton-active_wrapper-0.1.9 lib/active_wrapper.rb
winton-active_wrapper-0.2.0 lib/active_wrapper.rb
active_wrapper-0.2.0 lib/active_wrapper.rb