Bugfixes and Rails Edge
Update to Rails 2.3.1. (Actually, not quite. Doesn't look like 2.3.1 will be released today, but I REALLY want to push these bugfixes out.) Removed bundled Rack (Rails 2.3.1 comes bundled with Rack 1.0). Add config.action_view.cache_template_loading = true to production environment. Fix FastCGI bug (http://rubyforge.org/tracker/index.php?func=detail&aid=24191&group_id=186&atid=783). Fix WikiWords bug (http://rubyforge.org/pipermail/instiki-users/2009-February/001181.html).
This commit is contained in:
parent
0ddef97328
commit
133c21b801
641 changed files with 20541 additions and 71675 deletions
57
vendor/plugins/rack/test/testrequest.rb
vendored
57
vendor/plugins/rack/test/testrequest.rb
vendored
|
@ -1,57 +0,0 @@
|
|||
require 'yaml'
|
||||
require 'net/http'
|
||||
|
||||
class TestRequest
|
||||
def call(env)
|
||||
status = env["QUERY_STRING"] =~ /secret/ ? 403 : 200
|
||||
env["test.postdata"] = env["rack.input"].read
|
||||
body = env.to_yaml
|
||||
size = body.respond_to?(:bytesize) ? body.bytesize : body.size
|
||||
[status, {"Content-Type" => "text/yaml", "Content-Length" => size.to_s}, [body]]
|
||||
end
|
||||
|
||||
module Helpers
|
||||
attr_reader :status, :response
|
||||
|
||||
def GET(path, header={})
|
||||
Net::HTTP.start(@host, @port) { |http|
|
||||
user = header.delete(:user)
|
||||
passwd = header.delete(:passwd)
|
||||
|
||||
get = Net::HTTP::Get.new(path, header)
|
||||
get.basic_auth user, passwd if user && passwd
|
||||
http.request(get) { |response|
|
||||
@status = response.code.to_i
|
||||
@response = YAML.load(response.body)
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def POST(path, formdata={}, header={})
|
||||
Net::HTTP.start(@host, @port) { |http|
|
||||
user = header.delete(:user)
|
||||
passwd = header.delete(:passwd)
|
||||
|
||||
post = Net::HTTP::Post.new(path, header)
|
||||
post.form_data = formdata
|
||||
post.basic_auth user, passwd if user && passwd
|
||||
http.request(post) { |response|
|
||||
@status = response.code.to_i
|
||||
@response = YAML.load(response.body)
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class StreamingRequest
|
||||
def self.call(env)
|
||||
[200, {"Content-Type" => "text/plain"}, new]
|
||||
end
|
||||
|
||||
def each
|
||||
yield "hello there!\n"
|
||||
sleep 5
|
||||
yield "that is all.\n"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue