ohm 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/lib/ohm/redis.rb +5 -2
  2. data/lib/ohm.rb +0 -1
  3. metadata +2 -3
  4. data/lib/ohm/compat.rb +0 -12
data/lib/ohm/redis.rb CHANGED
@@ -240,9 +240,12 @@ module Ohm
240
240
  def format_bulk_reply(line)
241
241
  bulklen = line.to_i
242
242
  return nil if bulklen == -1
243
- reply = @sock.read(bulklen).force_encoding("UTF-8")
243
+ reply = @sock.read(bulklen)
244
244
  @sock.read(2) # Discard CRLF.
245
- reply
245
+
246
+ reply.respond_to?(:force_encoding) ?
247
+ reply.force_encoding("UTF-8") :
248
+ reply
246
249
  end
247
250
 
248
251
  def format_multi_bulk_reply(line)
data/lib/ohm.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require "base64"
4
- require File.join(File.dirname(__FILE__), "ohm", "compat")
5
4
  require File.join(File.dirname(__FILE__), "ohm", "redis")
6
5
  require File.join(File.dirname(__FILE__), "ohm", "validations")
7
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Martens
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-10-07 00:00:00 -03:00
13
+ date: 2009-10-26 00:00:00 -03:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -25,7 +25,6 @@ extensions: []
25
25
  extra_rdoc_files: []
26
26
 
27
27
  files:
28
- - lib/ohm/compat.rb
29
28
  - lib/ohm/redis.rb
30
29
  - lib/ohm/validations.rb
31
30
  - lib/ohm.rb
data/lib/ohm/compat.rb DELETED
@@ -1,12 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- # This file provides Ruby 1.8 compatibility. The intended functionality
4
- # is not present, because we cannot guess the original encoding, thus
5
- # making Iconv unsuitable for a conversion.
6
- if RUBY_VERSION < "1.9"
7
- class String
8
- def force_encoding(encoding)
9
- self
10
- end
11
- end
12
- end