Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…into Asquera-1.9.2fixes
  • Loading branch information...
commit 289eace6ebf4c89075c0118e793bfdc0c98b0e6c 2 parents 28eb378 + 373ec6c
@freels authored
View
4 lib/kestrel/client/stats_helper.rb
@@ -69,9 +69,9 @@ def merge_stats(all_stats)
def deserialize_stat_value(value)
case value
- when /^\d+\.\d+$/:
+ when /^\d+\.\d+$/
value.to_f
- when /^\d+$/:
+ when /^\d+$/
value.to_i
else
value
View
20 lib/kestrel/client/unmarshal.rb
@@ -11,11 +11,21 @@ def get(key, opts = {})
response
end
end
-
- def is_marshaled?(object)
- object.to_s[0] == Marshal::MAJOR_VERSION && object.to_s[1] == Marshal::MINOR_VERSION
- rescue Exception
- false
+
+ if RUBY_VERSION.respond_to?(:getbyte)
+ def is_marshaled?(object)
+ o = object.to_s
+ o.getbyte(0) == Marshal::MAJOR_VERSION && o.getbyte(1) == Marshal::MINOR_VERSION
+ rescue Exception
+ false
+ end
+ else
+ def is_marshaled?(object)
+ o = object.to_s
+ o[0] == Marshal::MAJOR_VERSION && o[1] == Marshal::MINOR_VERSION
+ rescue Exception
+ false
+ end
end
end
end
View
2  spec/kestrel_benchmark.rb
@@ -20,7 +20,7 @@
x.report("set:") { for i in 1..times; @kestrel.set(@queue, @value); end }
x.report("get:") { for i in 1..times; @kestrel.get(@queue); end }
x.report("set (raw):") { for i in 1..times; @kestrel.set(@queue, @raw_value, 0, true); end }
- x.report("get (raw):") { for i in 1..times; @kestrel.get(@queue, true); end }
+ x.report("get (raw):") { for i in 1..times; @kestrel.get(@queue, :raw => true); end }
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.