Sha256: 7444d1fc337f82e4f4d0d5c1be9fc49cb3c259bda896c9d86bb016e829069670

Contents?: true

Size: 747 Bytes

Versions: 16

Compression:

Stored size: 747 Bytes

Contents

require File.dirname(__FILE__) + '/active_wrapper/gems'

ActiveWrapper::Gems.activate %w(activerecord)

require 'active_record'
require 'fileutils'
require 'logger'
require 'yaml'

$:.unshift File.dirname(__FILE__) + '/active_wrapper'

require 'db'
require 'log'

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

ActiveRecord::Base.default_timezone = :utc

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
active_wrapper-solo-0.4.9 lib/active_wrapper.rb
active_wrapper-ar2-0.4.9 lib/active_wrapper.rb
active_wrapper-0.4.9 lib/active_wrapper.rb
active_wrapper-0.4.7 lib/active_wrapper.rb
active_wrapper-solo-0.4.6 lib/active_wrapper.rb
active_wrapper-ar2-0.4.6 lib/active_wrapper.rb
active_wrapper-0.4.6 lib/active_wrapper.rb
active_wrapper-solo-0.4.5 lib/active_wrapper.rb
active_wrapper-ar2-0.4.5 lib/active_wrapper.rb
active_wrapper-0.4.5 lib/active_wrapper.rb
active_wrapper-solo-0.4.4 lib/active_wrapper.rb
active_wrapper-ar2-0.4.4 lib/active_wrapper.rb
active_wrapper-0.4.4 lib/active_wrapper.rb
active_wrapper-solo-0.4.3 lib/active_wrapper.rb
active_wrapper-ar2-0.4.3 lib/active_wrapper.rb
active_wrapper-0.4.3 lib/active_wrapper.rb