While responding Puma checks whether response body responds to to_ary and it does since this change and this change in Rails repo. Then this to_ary method is called on ZipGenerator. However Puma does additional check on the result of this method with array_body.is_a?(Array) and falls back to body = res_body if this check doesn't pass. I believe this PR only works due to Puma making this check and much better option would be supporting call of ZipGenerator#each w/o block. Rack also supports call method for "streaming body", but I'm not sure it will work, with Buffer always responding to to_ary 🤔
by @fizvlad
resolves #91