-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce API version namespaces and implement Gems::V2.info
#66
Conversation
Addresses #2
Addresses #2
@marcoroth rebase should fix CI 🙏 |
Just rebased, Edit: Ah, I guess it's the test coverage, will add a test |
Feel free to ignore CodeClimate, but indeed specs are failing because of some method is missing coverage, but it fails hard because of probably some change in never simplecov. Repo is missing |
Added some tests to bring the coverage back up |
This one should be ready from my POV. |
Would love to see a new version released with this change! 😄 |
This pull request introduces the
V1
andV2
namespaces to handle both Rubygems.org APIs.My main motivation was to use the
/api/v2/rubygems/:gem/versions/:version.json
endpoint with thegems
gem.The existing
Gems::Client
implementation was moved into theV1
namespace asGems::V1::Client
. I created a newV2
client asGems::V2::Client
which implements the above mentioned endpoint.The
Gems::Client
still exists and inherits fromGems::V1::Client
to be backwards compatible.Also the class methods on
Gems
remain and delegate their methods to anGems::Client
/Gems::V1::Client
instance.Additionally all the
V1
methods can also be accessed through theV1
module (this might help with future deprecation):The
V2
methods can only be accessed by explicitly calling them on theV2
module:I introduced a
AbstractClient
mixin to share the behavior between the class methods onGems
,Gems::V1
andGems::V2
.Let me know if you have any feedback! Thank you!