deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [4/11] git commit: Core: Fixed warning under Ruby 1.8 in rack_etag
Date Tue, 07 Aug 2012 17:17:48 GMT
Core: Fixed warning under Ruby 1.8 in rack_etag

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


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/2b9fdadd
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/2b9fdadd
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/2b9fdadd

Branch: refs/heads/master
Commit: 2b9fdaddd30954262322de146ca0ba4bd232a34a
Parents: 2eb5d1a
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Fri Aug 3 15:04:57 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue Aug 7 19:14:03 2012 +0200

----------------------------------------------------------------------
 server/lib/sinatra/rack_etag.rb |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2b9fdadd/server/lib/sinatra/rack_etag.rb
----------------------------------------------------------------------
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]


Mime
View raw message