lib/fastcache.rb in binary42-fastcache-0.1 vs lib/fastcache.rb in binary42-fastcache-0.2
- old
+ new
@@ -12,11 +12,11 @@
require 'fastcache/hash/md5'
require 'fastcache/hash/sha1'
# Key routers
# TODO: Check for ruby-ketama
-require 'fastcache/router/basic'
+require 'fastcache/routing/basic_router'
# Networking and protocol support code
require 'fastcache/memcache'
# Interfaces
@@ -30,13 +30,14 @@
opts = {
:name => 'default',
:type => 'raw'
}.merge(opts)
- connections[opts[:name]].close if connections[opts[:name]]
+ connections[opts[:name]].close_all_connections if connections[opts[:name]]
- nodes = node_list.split(',').map {|node|
+ node_list = node_list.split(',') if String === node_list
+ nodes = node_list.map {|node|
host, port = *node.split(':')
port ||= 80
[host, port.to_i]
}
@@ -63,6 +64,6 @@
def connections
@connections ||= {}
end
-end
+end
\ No newline at end of file