Skip to content

Commit

Permalink
Removed compat.rb and added force_encoding check (Jarod Reid / http:/…
Browse files Browse the repository at this point in the history
  • Loading branch information
soveran committed Oct 26, 2009
1 parent ef04918 commit 35af0a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
1 change: 0 additions & 1 deletion lib/ohm.rb
@@ -1,7 +1,6 @@
# encoding: UTF-8

require "base64"
require File.join(File.dirname(__FILE__), "ohm", "compat")
require File.join(File.dirname(__FILE__), "ohm", "redis")
require File.join(File.dirname(__FILE__), "ohm", "validations")

Expand Down
12 changes: 0 additions & 12 deletions lib/ohm/compat.rb

This file was deleted.

7 changes: 5 additions & 2 deletions lib/ohm/redis.rb
Expand Up @@ -240,9 +240,12 @@ def format_integer_reply(line)
def format_bulk_reply(line)
bulklen = line.to_i
return nil if bulklen == -1
reply = @sock.read(bulklen).force_encoding("UTF-8")
reply = @sock.read(bulklen)
@sock.read(2) # Discard CRLF.
reply

reply.respond_to?(:force_encoding) ?
reply.force_encoding("UTF-8") :
reply
end

def format_multi_bulk_reply(line)
Expand Down

0 comments on commit 35af0a5

Please sign in to comment.