Rails 2.1 RC1

Updated Instiki to Rails 2.1 RC1 (aka 2.0.991).
This commit is contained in:
Jacques Distler 2008-05-17 23:22:34 -05:00
parent 14afed5893
commit 5292899c9a
971 changed files with 46318 additions and 17450 deletions

View file

@ -9,8 +9,8 @@ module ActiveResource
@responses = responses
end
for method in [ :post, :put, :get, :delete ]
module_eval <<-EOE
for method in [ :post, :put, :get, :delete, :head ]
module_eval <<-EOE, __FILE__, __LINE__
def #{method}(path, request_headers = {}, body = nil, status = 200, response_headers = {})
@responses[Request.new(:#{method}, path, nil, request_headers)] = Response.new(body || "", status, response_headers)
end
@ -47,21 +47,21 @@ module ActiveResource
end
for method in [ :post, :put ]
module_eval <<-EOE
module_eval <<-EOE, __FILE__, __LINE__
def #{method}(path, body, headers)
request = ActiveResource::Request.new(:#{method}, path, body, headers)
self.class.requests << request
self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for: \#{request.inspect}"))
self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for \#{request}"))
end
EOE
end
for method in [ :get, :delete ]
module_eval <<-EOE
for method in [ :get, :delete, :head ]
module_eval <<-EOE, __FILE__, __LINE__
def #{method}(path, headers)
request = ActiveResource::Request.new(:#{method}, path, nil, headers)
self.class.requests << request
self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for: \#{request.inspect}"))
self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for \#{request}"))
end
EOE
end
@ -75,8 +75,7 @@ module ActiveResource
attr_accessor :path, :method, :body, :headers
def initialize(method, path, body = nil, headers = {})
@method, @path, @body, @headers = method, path, body, headers.dup
@headers.update('Content-Type' => 'application/xml')
@method, @path, @body, @headers = method, path, body, headers.reverse_merge('Content-Type' => 'application/xml')
end
def ==(other_request)