lib/morlock/gem_client.rb in morlock-0.0.4 vs lib/morlock/gem_client.rb in morlock-0.0.6

- old
+ new

@@ -1,9 +1,9 @@ class Morlock - class UnknownGemClient < StandardError; - end + class UnknownGemClient < StandardError; end + class GemClient GEM_CLIENTS = [] def initialize(client) @client = client @@ -16,18 +16,18 @@ if (eval(gem) rescue false) && client.is_a?(eval(gem)) return gem_client.new(client) end end - raise UnknownGemClient.new("You provided Morlock a memcached client of an unknown type: #{client.class}") + raise UnknownGemClient.new("You provided Morlock with a memcached client of an unknown type: #{client.class}") end - def no_server_error(e) - STDERR.puts "WARNING: No memcached server found; Memlock was unable to create a lock. (#{e.message})" + STDERR.puts "WARNING: No memcached server was found; Memlock was unable to create a lock. (#{e.message})" true end end + class DalliGemClient < GemClient def add(key, expiration) @client.add(key, 1, expiration) rescue => e \ No newline at end of file