notes:
1) moved supported_collection to base_driver and given it a credentials
parameter
2) This means we can get rid of the Thread.current["credentials"] business
altogether since the credentials are passed from the GET /api request so
LazyAuth works as intended.
3) I kept the actual definition of 'supported_collections' as in the original
- I don't see the benefit of changing this. The way I understand it currently:
=> each collection defines a lambda like :
set :capability, lambda { |m| driver.respond_to? m }$
=> the supported_collections method calls this lamba:
m.settings.capability(index_operation_capability)
(where 'index_operation_capability' is :buckets, in this case)
So the result is supported_collections checks if a driver supports a given
collection by calling respond_to?(collection_name) on the driver. Is this bad?
With these additions, each driver can just override supported_collections as
David suggests anyway.
marios