Skip to content

Commit

Permalink
Remove Ruby 1.9 references from the spec (#2179)
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed May 10, 2024
1 parent 9a5f6c2 commit e429991
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions SPEC.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ exceptions. They should be invoked in reverse order of registration.
The input stream is an IO-like object which contains the raw HTTP
POST data.
When applicable, its external encoding must be "ASCII-8BIT" and it
must be opened in binary mode, for Ruby 1.9 compatibility.
must be opened in binary mode.
The input stream must respond to +gets+, +each+, and +read+.
* +gets+ must be called without arguments and return a string,
or +nil+ on EOF.
Expand Down Expand Up @@ -303,9 +303,6 @@ It must only be called once.
It must not be called after being closed,
and must only yield String values.

The Body itself should not be an instance of String, as this will
break in Ruby 1.9.

Middleware must not call +each+ directly on the Body.
Instead, middleware can return a new Body that calls +each+ on the
original Body, yielding at least once per iteration.
Expand Down
5 changes: 1 addition & 4 deletions lib/rack/lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def check_environment(env)
## POST data.
def check_input_stream(input)
## When applicable, its external encoding must be "ASCII-8BIT" and it
## must be opened in binary mode, for Ruby 1.9 compatibility.
## must be opened in binary mode.
if input.respond_to?(:external_encoding) && input.external_encoding != Encoding::ASCII_8BIT
raise LintError, "rack.input #{input} does not have ASCII-8BIT as its external encoding"
end
Expand Down Expand Up @@ -791,9 +791,6 @@ def each
raise LintError, "Body yielded non-string value #{chunk.inspect}"
end

##
## The Body itself should not be an instance of String, as this will
## break in Ruby 1.9.
##
## Middleware must not call +each+ directly on the Body.
## Instead, middleware can return a new Body that calls +each+ on the
Expand Down

0 comments on commit e429991

Please sign in to comment.