[core] Deprecate Fog::Connection

This reapplies the deprecation warnings that were originally part of
7ee3535 when using Fog::Connection request.

Unfortunately the Mock world does not exercise any of the code affected
by this change so I missed that I had adjusted the signature of the
method.

If you pass a parser argument into Fog::Connection you should switch to
using Fog::XML::SAXParserConnection and pass the parser as the first
argument to `#request`

If you don't it is better to use Fog::Core::Connection to get rid of the
backwards compatibility code and XML dependency.

This will make fog VERY NOISY since you'll get output for every request
on out of date services.
This commit is contained in:
Paul Thornthwaite 2014-02-26 09:56:40 +00:00
parent 45f9826b83
commit 7f37977d2e
1 changed files with 2 additions and 0 deletions

View File

@ -15,8 +15,10 @@ module Fog
class Connection < Fog::XML::SAXParserConnection
def request(params, &block)
if (parser = params.delete(:parser))
Fog::Logger.deprecation("Fog::Connection is deprecated use Fog::XML::SAXParserConnection instead [light_black](#{caller.first})[/]")
super(parser, params)
else
Fog::Logger.deprecation("Fog::Connection is deprecated use Fog::Core::Connection instead [light_black](#{caller.first})[/]")
original_request(params)
end
end