deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 7/8] Core: Fixed warning under Ruby 1.8 in rack_etag
Date Fri, 03 Aug 2012 13:15:30 GMT
From: Michal Fojtik <mfojtik@redhat.com>

* Warning: multiple values for a block parameter (2 for 1)
  occurs because each yields two values but just captured one.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/sinatra/rack_etag.rb |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/server/lib/sinatra/rack_etag.rb b/server/lib/sinatra/rack_etag.rb
index 50d12e8..14a8cd4 100644
--- a/server/lib/sinatra/rack_etag.rb
+++ b/server/lib/sinatra/rack_etag.rb
@@ -68,7 +68,11 @@ module Rack
 
       def digest_body(body)
         parts = []
-        body.each { |part| parts << part }
+        if RUBY_VERSION =~ /^1\.8/
+          body.each { |part, b| parts << part }
+        else
+          body.each { |part| parts << part }
+        end
         string_body = parts.join
         digest = Digest::MD5.hexdigest(string_body) unless string_body.empty?
         [digest, parts]
-- 
1.7.10.2


Mime
View raw message