Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch '1.9.2fixes' of http://github.com/Asquera/kestrel-client

…into Asquera-1.9.2fixes
commit 289eace6ebf4c89075c0118e793bfdc0c98b0e6c 2 parents 28eb378 + 373ec6c
Matt Freels authored
4 lib/kestrel/client/stats_helper.rb
@@ -69,9 +69,9 @@ def merge_stats(all_stats)
69 69
70 70 def deserialize_stat_value(value)
71 71 case value
72   - when /^\d+\.\d+$/:
  72 + when /^\d+\.\d+$/
73 73 value.to_f
74   - when /^\d+$/:
  74 + when /^\d+$/
75 75 value.to_i
76 76 else
77 77 value
20 lib/kestrel/client/unmarshal.rb
@@ -11,11 +11,21 @@ def get(key, opts = {})
11 11 response
12 12 end
13 13 end
14   -
15   - def is_marshaled?(object)
16   - object.to_s[0] == Marshal::MAJOR_VERSION && object.to_s[1] == Marshal::MINOR_VERSION
17   - rescue Exception
18   - false
  14 +
  15 + if RUBY_VERSION.respond_to?(:getbyte)
  16 + def is_marshaled?(object)
  17 + o = object.to_s
  18 + o.getbyte(0) == Marshal::MAJOR_VERSION && o.getbyte(1) == Marshal::MINOR_VERSION
  19 + rescue Exception
  20 + false
  21 + end
  22 + else
  23 + def is_marshaled?(object)
  24 + o = object.to_s
  25 + o[0] == Marshal::MAJOR_VERSION && o[1] == Marshal::MINOR_VERSION
  26 + rescue Exception
  27 + false
  28 + end
19 29 end
20 30 end
21 31 end
2  spec/kestrel_benchmark.rb
@@ -20,7 +20,7 @@
20 20 x.report("set:") { for i in 1..times; @kestrel.set(@queue, @value); end }
21 21 x.report("get:") { for i in 1..times; @kestrel.get(@queue); end }
22 22 x.report("set (raw):") { for i in 1..times; @kestrel.set(@queue, @raw_value, 0, true); end }
23   - x.report("get (raw):") { for i in 1..times; @kestrel.get(@queue, true); end }
  23 + x.report("get (raw):") { for i in 1..times; @kestrel.get(@queue, :raw => true); end }
24 24 end
25 25 end
26 26 end

0 comments on commit 289eace

Please sign in to comment.
Something went wrong with that request. Please try again.