Sha256: 934fdc6835413d9ec81c9d831fcbb3aa3cdb2f9dd45bd08f6a0dd004c5752a05

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

require 'rubygems'
begin
  require 'couchrest'
rescue LoadError => e
  raise Capcode::MissingLibrary, "CouchRest could not be loaded (is it installed?): #{e.message}"
end
require 'yaml'
require 'logger'

module Capcode
  module Resource
  end
  
  class Base < CouchRest::ExtendedDocument
    use_database @db
  end
  
  class << self
    def db_connect( dbfile, logfile )
      dbconfig = YAML::load(File.open(dbfile)).keys_to_sym
      @db = CouchRest.database!("#{dbconfig[:host]}/#{dbconfig[:database]}")
      # TODO: Add logger
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capcode-base-couchrest-0.1.0 lib/capcode/base/couchrest.rb