Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Relax Lint slightly to allow subclasses of the required types"

This reverts commit 663a438.
  • Loading branch information...
commit 99c47b8002a6cae393ea09c341827b1119396a7b 1 parent 663a438
@raggi raggi authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 lib/rack/lint.rb
View
18 lib/rack/lint.rb
@@ -61,7 +61,7 @@ def check_env(env)
## subclassing allowed) that includes CGI-like headers.
## The application is free to modify the environment.
assert("env #{env.inspect} is not a Hash, but #{env.class}") {
- env.kind_of? Hash
+ env.instance_of? Hash
}
##
@@ -175,7 +175,7 @@ def check_env(env)
env.each { |key, value|
next if key.include? "." # Skip extensions
assert("env variable #{key} has non-string value #{value.inspect}") {
- value.kind_of? String
+ value.instance_of? String
}
}
@@ -184,7 +184,7 @@ def check_env(env)
## * <tt>rack.version</tt> must be an array of Integers.
assert("rack.version must be an Array, was #{env["rack.version"].class}") {
- env["rack.version"].kind_of? Array
+ env["rack.version"].instance_of? Array
}
## * <tt>rack.url_scheme</tt> must either be +http+ or +https+.
assert("rack.url_scheme unknown: #{env["rack.url_scheme"].inspect}") {
@@ -269,7 +269,7 @@ def gets(*args)
assert("rack.input#gets called with arguments") { args.size == 0 }
v = @input.gets
assert("rack.input#gets didn't return a String") {
- v.nil? or v.kind_of? String
+ v.nil? or v.instance_of? String
}
v
end
@@ -304,7 +304,7 @@ def read(*args)
v = @input.read(*args)
assert("rack.input#read didn't return nil or a String") {
- v.nil? or v.kind_of? String
+ v.nil? or v.instance_of? String
}
if args[0].nil?
assert("rack.input#read(nil) returned nil on EOF") {
@@ -320,7 +320,7 @@ def each(*args)
assert("rack.input#each called with arguments") { args.size == 0 }
@input.each { |line|
assert("rack.input#each didn't yield a String") {
- line.kind_of? String
+ line.instance_of? String
}
yield line
}
@@ -373,7 +373,7 @@ def puts(str)
## * +write+ must be called with a single argument that is a String.
def write(str)
- assert("rack.errors#write not called with a String") { str.kind_of? String }
+ assert("rack.errors#write not called with a String") { str.instance_of? String }
@error.write str
end
@@ -407,7 +407,7 @@ def check_headers(header)
header.each { |key, value|
## The header keys must be Strings.
assert("header key must be a string, was #{key.class}") {
- key.kind_of? String
+ key.instance_of? String
}
## The header must not contain a +Status+ key,
assert("header must not contain Status") { key.downcase != "status" }
@@ -499,7 +499,7 @@ def each
@body.each { |part|
## and must only yield String values.
assert("Body yielded non-string value #{part.inspect}") {
- part.kind_of? String
+ part.instance_of? String
}
yield part
}
Please sign in to comment.
Something went wrong with that request. Please try again.