Cerales/Re-Laxation — Issue #1: Allow globally configuring the library
Author: Cerales
Created: 2011-12-28 04:09:19+00:00
State: open
Labels: Feature

Support a single global configuration where methods can be called on the Relaxation module object as if a database object had been instantiated. This is useful for scripts and simple projects, as long as only one database needs to be used.

Like this:

````ruby
Relaxation.configure do |config|
globalConfiguration = true
config.host = 'localhost'
config.port = '5984'
config.databaseName = 'test'
config.user = 'user'
config.password = 'password'
config.includeDesign = {
_id: :testDesign, views: {
testView: { map: "function (doc) { emit(doc); }" }
}
}
end

Relaxation.getDocumentById('123456')

Relaxation.design(:testDesign).view(:testView)

````