chargebee-ruby icon indicating copy to clipboard operation
chargebee-ruby copied to clipboard

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

Open cb-alish opened this issue 1 year ago • 4 comments

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.

cb-alish avatar Nov 04 '24 09:11 cb-alish

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

formigarafa avatar Nov 06 '24 23:11 formigarafa

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

jamescook avatar Dec 18 '24 15:12 jamescook

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.

cb-alish avatar Dec 18 '24 15:12 cb-alish

@cb-alish this one can be closed, we no longer use rest-client on this gem.

sobrinho avatar Jun 06 '25 13:06 sobrinho

Sure @sobrinho, closing this 🙌

cb-alish avatar Jun 06 '25 14:06 cb-alish