summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-01-30 12:21:29 -0800
committerJeremy Evans <code@jeremyevans.net>2020-01-30 12:28:56 -0800
commit06d23735ca8ea82ec1a6abdb1cb9158454a00eb0 (patch)
tree75afb2cb1619f22f0db726cc3b9b3cbd91893bf9
parentf16d271e9bd02591b059dae29f32b6fe565647f8 (diff)
downloadrack-06d23735ca8ea82ec1a6abdb1cb9158454a00eb0.tar.gz
Remove BodyProxy#each
This was added due to issue #434, but the links in that issue make clear it is only needed in Ruby <1.9.3. As Ruby 2.3+ is now required, this should be safe to remove.
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/rack/body_proxy.rb8
-rw-r--r--test/spec_body_proxy.rb4
3 files changed, 1 insertions, 12 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a9db392d..c5f5416e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,6 +33,7 @@ All notable changes to this project will be documented in this file. For info on
### Removed
+- `BodyProxy#each` as it was only needed to work around a bug in Ruby <1.9.3. ([@jeremyevans](https://github.com/jeremyevans))
- `Session::Abstract::SessionHash#transform_keys`, no longer needed. (pavel)
- `URLMap::INFINITY` and `URLMap::NEGATIVE_INFINITY`, in favor of `Float::INFINITY`. ([@ch1c0t](https://github.com/ch1c0t))
- Deprecation of `Rack::File`. It will be deprecated again in rack 2.2 or 3.0. ([@rafaelfranca](https://github.com/rafaelfranca))
diff --git a/lib/rack/body_proxy.rb b/lib/rack/body_proxy.rb
index 559188e8..12347916 100644
--- a/lib/rack/body_proxy.rb
+++ b/lib/rack/body_proxy.rb
@@ -26,14 +26,6 @@ module Rack
@closed
end
- # N.B. This method is a special case to address the bug described by #434.
- # We are applying this special case for #each only. Future bugs of this
- # class will be handled by requesting users to patch their ruby
- # implementation, to save adding too many methods in this class.
- def each
- @body.each { |body| yield body }
- end
-
def method_missing(method_name, *args, &block)
@body.__send__(method_name, *args, &block)
end
diff --git a/test/spec_body_proxy.rb b/test/spec_body_proxy.rb
index a21b03ec..fe70d2ef 100644
--- a/test/spec_body_proxy.rb
+++ b/test/spec_body_proxy.rb
@@ -85,8 +85,4 @@ describe Rack::BodyProxy do
proxy.close
closed.must_equal true
end
-
- it 'provide an #each method' do
- Rack::BodyProxy.method_defined?(:each).must_equal true
- end
end