diff options
author | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-08-21 19:04:39 +0200 |
---|---|---|
committer | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-08-21 19:04:39 +0200 |
commit | aad429a46e3017fa7ca73f58428693e821be42b6 (patch) | |
tree | f749e0cdeab20c7f4be37ff49e064705f17cdfa5 /activeresource | |
parent | cf6840773b4f5046151f4d28c286069aabaafa10 (diff) | |
parent | 8622787f8748434b4ceb2b925a35b17a38e1f2d6 (diff) | |
download | rails-aad429a46e3017fa7ca73f58428693e821be42b6.tar.gz rails-aad429a46e3017fa7ca73f58428693e821be42b6.tar.bz2 rails-aad429a46e3017fa7ca73f58428693e821be42b6.zip |
Merge branch 'master' into i18n
Diffstat (limited to 'activeresource')
-rw-r--r-- | activeresource/CHANGELOG | 2 | ||||
-rw-r--r-- | activeresource/lib/active_resource/connection.rb | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/activeresource/CHANGELOG b/activeresource/CHANGELOG index 673e20de28..b62aa91b45 100644 --- a/activeresource/CHANGELOG +++ b/activeresource/CHANGELOG @@ -1,5 +1,7 @@ *Edge* +* Fixed problems with the logger used if the logging string included %'s [#840 state:resolved] (Jamis Buck) + * Fixed Base#exists? to check status code as integer [#299 state:resolved] (Wes Oldenbeuving) diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb index 0c4ea432d7..d64fb79f1e 100644 --- a/activeresource/lib/active_resource/connection.rb +++ b/activeresource/lib/active_resource/connection.rb @@ -28,24 +28,24 @@ module ActiveResource # 3xx Redirection class Redirection < ConnectionError # :nodoc: - def to_s; response['Location'] ? "#{super} => #{response['Location']}" : super; end - end + def to_s; response['Location'] ? "#{super} => #{response['Location']}" : super; end + end # 4xx Client Error class ClientError < ConnectionError; end # :nodoc: - + # 400 Bad Request class BadRequest < ClientError; end # :nodoc - + # 401 Unauthorized class UnauthorizedAccess < ClientError; end # :nodoc - + # 403 Forbidden class ForbiddenAccess < ClientError; end # :nodoc - + # 404 Not Found class ResourceNotFound < ClientError; end # :nodoc: - + # 409 Conflict class ResourceConflict < ClientError; end # :nodoc: @@ -140,7 +140,7 @@ module ActiveResource 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 "--> #{result.code} #{result.message} (#{result.body ? result.body.length : 0}b %.2fs)" % time if logger + logger.info "--> %d %s (%d %.2fs)" % [result.code, result.message, result.body ? result.body.length : 0, time] if logger handle_response(result) rescue Timeout::Error => e raise TimeoutError.new(e.message) @@ -201,7 +201,7 @@ module ActiveResource end def logger #:nodoc: - ActiveResource::Base.logger + Base.logger end end end |