Permalink
Browse files

Re-indented the code.

  • Loading branch information...
1 parent ad7b716 commit d116d6e7236facd0f73ef8250415bc27e738d5fc @fredjean fredjean committed Jun 30, 2010
Showing with 271 additions and 271 deletions.
  1. +9 −9 lib/memcache.rb
  2. +262 −262 spec/jruby_memcache_spec.rb
View
@@ -85,11 +85,11 @@ def initialize(*args)
raise ArgumentError, "wrong number of arguments (#{args.length} for 2)"
end
- # Normalizing the server(s) so they all have a port number.
-
- @servers = @servers.map do |server|
- server =~ /(.+):(\d+)/ ? server : "#{server}:#{DEFAULT_PORT}"
- end
+ # Normalizing the server(s) so they all have a port number.
+
+ @servers = @servers.map do |server|
+ server =~ /(.+):(\d+)/ ? server : "#{server}:#{DEFAULT_PORT}"
+ end
Logger.getLogger('com.meetup.memcached.MemcachedClient').setLevel(opts[:log_level])
Logger.getLogger('com.meetup.memcached.SockIOPool').setLevel(opts[:log_level])
@@ -139,14 +139,14 @@ def initialize(*args)
@pool.hashingAlg = opts[:pool_hashing_algorithm]
# __method methods have been removed in jruby 1.5
- @pool.java_send :initialize rescue @pool.initialize__method
+ @pool.java_send :initialize rescue @pool.initialize__method
end
end
def reset
@pool.shut_down
- @pool.java_send :initialize rescue @pool.initialize__method
+ @pool.java_send :initialize rescue @pool.initialize__method
end
##
@@ -267,7 +267,7 @@ def replace(key, value, expiry = 0, raw = false)
# Increments the value associated with the key by a certain amount.
def incr(key, amount = 1)
raise MemCacheError, "Update of readonly cache" if @readonly
- value = @client.incr(make_cache_key(key))
+ value = @client.incr(make_cache_key(key), amount)
return nil if value == "NOT_FOUND\r\n"
return value.to_i
end
@@ -276,7 +276,7 @@ def incr(key, amount = 1)
# Decrements the value associated with the key by a certain amount.
def decr(key, amount = 1)
raise MemCacheError, "Update of readonly cache" if @readonly
- value = @client.decr(make_cache_key(key))
+ value = @client.decr(make_cache_key(key),amount)
return nil if value == "NOT_FOUND\r\n"
return value.to_i
end
Oops, something went wrong.

0 comments on commit d116d6e

Please sign in to comment.