lib/rack/response.rb in rack-1.4.0 vs lib/rack/response.rb in rack-1.4.1
- old
+ new
@@ -10,11 +10,11 @@
# defaults (a OK response containing HTML).
#
# You can use Response#write to iteratively generate your response,
# but note that this is buffered by Rack::Response until you call
# +finish+. +finish+ however can take a block inside which calls to
- # +write+ are syncronous with the Rack response.
+ # +write+ are synchronous with the Rack response.
#
# Your application's +call+ should end returning Response#finish.
class Response
attr_accessor :length
@@ -110,24 +110,25 @@
end
alias headers header
module Helpers
- def invalid?; status < 100 || status >= 600; end
+ def invalid?; status < 100 || status >= 600; end
- def informational?; status >= 100 && status < 200; end
- def successful?; status >= 200 && status < 300; end
- def redirection?; status >= 300 && status < 400; end
- def client_error?; status >= 400 && status < 500; end
- def server_error?; status >= 500 && status < 600; end
+ def informational?; status >= 100 && status < 200; end
+ def successful?; status >= 200 && status < 300; end
+ def redirection?; status >= 300 && status < 400; end
+ def client_error?; status >= 400 && status < 500; end
+ def server_error?; status >= 500 && status < 600; end
- def ok?; status == 200; end
- def bad_request?; status == 400; end
- def forbidden?; status == 403; end
- def not_found?; status == 404; end
- def unprocessable?; status == 422; end
+ def ok?; status == 200; end
+ def bad_request?; status == 400; end
+ def forbidden?; status == 403; end
+ def not_found?; status == 404; end
+ def method_not_allowed?; status == 405; end
+ def unprocessable?; status == 422; end
- def redirect?; [301, 302, 303, 307].include? status; end
+ def redirect?; [301, 302, 303, 307].include? status; end
# Headers
attr_reader :headers, :original_headers
def include?(header)