Add couchbase with modifications, formalize broadcaster and make testable and some other stuff
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# This is a replacement of the couchbase settings gem. The quality of this gem is not sufficient to
|
||||
# work with. Since couchbase structures/docstore are using CouchbaseSetting we supply the right settings
|
||||
# here
|
||||
|
||||
module CouchbaseSetting
|
||||
mattr_accessor :config_type
|
||||
mattr_accessor :configs
|
||||
|
||||
def self.server
|
||||
config :server, default: '127.0.0.1'
|
||||
end
|
||||
|
||||
def self.bucket
|
||||
config :bucket, default: 'qwaiter'
|
||||
end
|
||||
|
||||
def self.config(setting, default: nil)
|
||||
configs[config_type][Rails.env.to_sym][setting] || default
|
||||
end
|
||||
end
|
||||
|
||||
CouchbaseSetting.configs = {
|
||||
supplier_counters: {
|
||||
development: {
|
||||
bucket: 'qwaiter_development'
|
||||
},
|
||||
test:{
|
||||
bucket: 'qwaiter_development'
|
||||
},
|
||||
production: {}
|
||||
},
|
||||
queue: {
|
||||
development: {
|
||||
bucket: 'qwaiter_development'
|
||||
},
|
||||
test:{
|
||||
bucket: 'qwaiter_development'
|
||||
},
|
||||
production: {}
|
||||
}
|
||||
}
|
||||
|
||||
# only one in use at the moment
|
||||
CouchbaseSetting.config_type = :supplier_counters
|
||||
Reference in New Issue
Block a user