Instiki 0.16.3: Rails 2.3.0
Instiki now runs on the Rails 2.3.0 Candidate Release. Among other improvements, this means that it now automagically selects between WEBrick and Mongrel. Just run ./instiki --daemon
This commit is contained in:
parent
43aadecc99
commit
4e14ccc74d
893 changed files with 71965 additions and 28511 deletions
|
@ -202,6 +202,8 @@ module ActiveResource
|
|||
# sets the <tt>read_timeout</tt> of the internal Net::HTTP instance to the same value. The default
|
||||
# <tt>read_timeout</tt> is 60 seconds on most Ruby implementations.
|
||||
class Base
|
||||
##
|
||||
# :singleton-method:
|
||||
# The logger for diagnosing and tracing Active Resource calls.
|
||||
cattr_accessor :logger
|
||||
|
||||
|
@ -704,6 +706,7 @@ module ActiveResource
|
|||
def new?
|
||||
id.nil?
|
||||
end
|
||||
alias :new_record? :new?
|
||||
|
||||
# Gets the <tt>\id</tt> attribute of the resource.
|
||||
def id
|
||||
|
@ -743,8 +746,8 @@ module ActiveResource
|
|||
# # => true
|
||||
#
|
||||
def ==(other)
|
||||
other.equal?(self) || (other.instance_of?(self.class) && !other.new? && other.id == id)
|
||||
end
|
||||
other.equal?(self) || (other.instance_of?(self.class) && other.id == id && other.prefix_options == prefix_options)
|
||||
end
|
||||
|
||||
# Tests for equality (delegates to ==).
|
||||
def eql?(other)
|
||||
|
@ -1003,7 +1006,7 @@ module ActiveResource
|
|||
|
||||
# Takes a response from a typical create post and pulls the ID out
|
||||
def id_from_response(response)
|
||||
response['Location'][/\/([^\/]*?)(\.\w+)?$/, 1]
|
||||
response['Location'][/\/([^\/]*?)(\.\w+)?$/, 1] if response['Location']
|
||||
end
|
||||
|
||||
def element_path(options = nil)
|
||||
|
|
|
@ -146,8 +146,8 @@ module ActiveResource
|
|||
def request(method, path, *arguments)
|
||||
logger.info "#{method.to_s.upcase} #{site.scheme}://#{site.host}:#{site.port}#{path}" if logger
|
||||
result = nil
|
||||
time = Benchmark.realtime { result = http.send(method, path, *arguments) }
|
||||
logger.info "--> %d %s (%d %.2fs)" % [result.code, result.message, result.body ? result.body.length : 0, time] if logger
|
||||
ms = Benchmark.ms { result = http.send(method, path, *arguments) }
|
||||
logger.info "--> %d %s (%d %.0fms)" % [result.code, result.message, result.body ? result.body.length : 0, ms] if logger
|
||||
handle_response(result)
|
||||
rescue Timeout::Error => e
|
||||
raise TimeoutError.new(e.message)
|
||||
|
|
|
@ -54,6 +54,9 @@ module ActiveResource
|
|||
end
|
||||
|
||||
for method in [ :post, :put, :get, :delete, :head ]
|
||||
# def post(path, request_headers = {}, body = nil, status = 200, response_headers = {})
|
||||
# @responses[Request.new(:post, path, nil, request_headers)] = Response.new(body || "", status, response_headers)
|
||||
# end
|
||||
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)
|
||||
|
@ -118,6 +121,11 @@ module ActiveResource
|
|||
end
|
||||
|
||||
for method in [ :post, :put ]
|
||||
# def post(path, body, headers)
|
||||
# request = ActiveResource::Request.new(:post, path, body, headers)
|
||||
# self.class.requests << request
|
||||
# self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for #{request}"))
|
||||
# end
|
||||
module_eval <<-EOE, __FILE__, __LINE__
|
||||
def #{method}(path, body, headers)
|
||||
request = ActiveResource::Request.new(:#{method}, path, body, headers)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
module ActiveResource
|
||||
module VERSION #:nodoc:
|
||||
MAJOR = 2
|
||||
MINOR = 2
|
||||
TINY = 2
|
||||
MINOR = 3
|
||||
TINY = 0
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY].join('.')
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue