module Tako

Constants

VERSION

Public Class Methods

config() click to toggle source
# File lib/tako.rb, line 32
def config
  Tako::Config.shards_yml[:tako]
end
env() click to toggle source
# File lib/tako.rb, line 36
def env
  Tako::Config.env
end
load_connections_from_yaml() click to toggle source
# File lib/tako.rb, line 25
def load_connections_from_yaml
  Tako::Repository.clear
  (config[env] || []).each do |shard_name, conf|
    Tako::Repository.add(shard_name, conf)
  end
end
shard(shard_name) { || ... } click to toggle source
# File lib/tako.rb, line 15
def shard(shard_name)
  if block_given?
    Tako::Repository.create_proxy(shard_name).with_shard do
      yield
    end
  else
    raise "gimme a block!"
  end
end