Skip to content
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

Removing rest-client as a dependency & using native NET:HTTP #85

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cb-alish
Copy link
Collaborator

@cb-alish cb-alish commented Nov 4, 2024

Replace Deprecated rest-client Dependency with Native Net::HTTP in ChargeBee Ruby SDK

Description:

This PR refactors the ChargeBee Ruby SDK to use Ruby's native Net::HTTP library, replacing the deprecated rest-client dependency. The rest-client gem, which ChargeBee Ruby previously relied on, has been deprecated and is no longer actively maintained. By switching to Net::HTTP, this update:

  • Removes an outdated dependency (rest-client) from the SDK, reducing potential security and maintenance concerns.
  • Utilizes Net::HTTP for HTTP requests, providing a more modern and lightweight solution aligned with Ruby's core library.
  • Maintains existing functionality and ensures compatibility for current users, without changes to the external API of the SDK.

Changes:

  • All instances of rest-client have been replaced with Net::HTTP for making HTTP requests.
  • Updated error handling and response parsing to match the behavior of rest-client.
  • Adjusted headers and request options for compatibility with Net::HTTP.

Testing and Validation:

  • Verified successful execution of all existing test cases to confirm that the migration does not impact current functionality.
  • This update is intended to be backward-compatible and should not require any changes for existing users of the ChargeBee Ruby SDK.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still need to remove the line 26, right?

  s.add_dependency('rest-client', '>=1.8', '<=2.0.2')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @formigarafa, thanks for the initial review! I’ve implemented the changes you suggested. Could you please re-review? Also, if possible, could you try running this in your test/sandbox environment to verify everything works as expected? Let us know if you encounter any issues.

@formigarafa
Copy link

All good and green ✅ on around here. Thanks. 👍

@jamescook
Copy link

This branch works on our end for the handful of Chargebee API calls we leverage.

@cb-alish
Copy link
Collaborator Author

Hi @jamescook , thank you for your efforts on this! We're planning to roll this out soon and are reviewing your PRs. Please bear with us as we take some time to look into them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants