Commit Graph

8 Commits

Author SHA1 Message Date
Joe Rafaniello d9559c610d Fix typo: Fog::Connection is deprecated, not Fog::XML::Connection.
Commit 0e1daf3d did a mass rename and accidentally renamed the intended deprecated method.
2014-12-04 14:08:07 -05:00
Paul Thornthwaite 2e0b7e545a Standardise empty lines throughout codebase
Done with `rubocop --auto-correct --only EmptyLineBetweenDefs,EmptyLines,EmptyLinesAroundBody`
2014-05-26 14:20:02 +01:00
Paul Thornthwaite 0e1daf3ddd [GH-2711] Replace Fog::Connection with XML shim
Unlike last attempt this replaces Fog::Connection with
Fog::XML::Connection which should be directly compatible.

Fog::Connection is there for old PRs but should be removed real soon.

Providers using JSON should be able to replace "XML" with "Core" within
their code to cut down on the dependency.

If I get the time I may attempt to clean up some but testing with Mock
will mean that is mostly educated guesswork.
2014-02-27 00:54:17 +00:00
Paul Thornthwaite 1768f2a37e [GH-2711] Add Fog::XML::Connection
Attempting to move to using Fog::XML::SAXParserConnection directly
failed because the arguments changed.

This adds another compatibility level with two key differences:

1) It's namespaced within XML so stands out as not being part of core
2) It is NOT creating deprecation warnings so can be used as the final
   step if rewriting to use SAXParserConnection is undesired

So when merged Fog::Connection usage will create noise.

Fog::XML::Connection works the same way and will be extracted to
"fog/xml" when we get to it.

Fog::Core::Connection just wraps Excon.request and leaves the response
body parsing to the provider.
2014-02-27 00:54:16 +00:00
Paul Thornthwaite 7f37977d2e [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.
2014-02-27 00:54:16 +00:00
Paul Thornthwaite 5007aac401 Revert "[core] Replace Fog::Connection with stable version"
This reverts commit 7ee3535d99.
2014-02-26 09:52:02 +00:00
Paul Thornthwaite 7ee3535d99 [core] Replace Fog::Connection with stable version
Fog::Connection mixed in XML parsing via the `parser` argument which
wasn't much use for the majority of APIs using JSON.

This adds the deprecation warning and attempts to update providers to
the correct version of Connection that they need.

Either the cleaner `Fog::Core::Connection` or if reliant on the XML
parsing still `Fog::XML::SAXParserConnection`

The SAX parser will be moving to `fog/xml` fairly soon.
2014-02-25 21:42:34 +00:00
Paul Thornthwaite 4123be9568 [core/xml] Splits SAX parsing from Connection
This creates a new `Fog::Core::Connection` class that wraps around HTTP
connections/requests but does not presume SAX parsing of the API response.

A new `Fog::XML::SAXParserConnection` is available which implements the
original behaviour with a clearer interface.

`Fog::Connection` subclasses `SAXParserConnection` to be backwards
compatible.

Further testing and deprecation warnings are needed.

Since mock testing occurs at a higher level the changed code is not
exercised by the tests and I do not have access to an XML based API to
debug quickly with.
2013-06-24 17:30:51 +01:00