Updating gem to fix APIs add 3.x support#10
Merged
Conversation
- Lots of breaking changes - Upgraded to modern Ruby 3.x. support - Replaced curb with http - Removed dynamic methods - More resturant/search attributes now defined - GH Actions - Adds bundler-audit
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
- Escape confirmation_number in cancel/status URLs to handle special chars - Validate slotlock has available times before creating request - Validate date_time is Time/DateTime object before calling strftime - Validate party_size is integer between 1-20 per API limits - Add .to_s to error ID comparisons for JSON integer compatibility - Add 30-second HTTP timeout to prevent indefinite hangs
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Updating gem to fix deprecated Ruby APIs and add Ruby 3.x support.
The old version used:
URI.encode/URI.decode(removed in Ruby 3.2+)curbgem (unmaintained, C-extension issues)method_missingfor attribute access (performance overhead, hard to debug)Breaking Changes
Ruby Version
HTTP Client
curbwithhttpgemMethod Definitions
method_missingdynamic methodsExample - No API changes needed:
What Changed
Code:
curbwithhttpgemmethod_missingwith explicitdefine_methodclass << selfTests:
Added Many new tests
All API endpoints covered
WebMock for HTTP stubbing
Added GitHub Actions CI
Tests Ruby 3.0, 3.1, 3.2, 3.3
Added bundler-audit security scanning
Testing with OpenTable
Prerequisites:
Setup:
Run tests:
Manual testing flow:
Without OpenTable access:
Note
Modernizes the gem for Ruby 3+, replaces curb with http, removes method_missing in favor of explicit methods, adds reservation status, robust error/HTTP handling, extensive tests, and CI.
>= 3.0; bump version to1.0.0and modernize gemspec/runtime deps (http,oauth,activesupport).URI.encode/decodewithCGI.escape/unescape.curbwithhttpclient and refactor request flow (GetRequest,PostRequest,Request#handle_http_errors).method_missing; explicitly define accessors forRestaurantandRestaurantSearchattributes.ReservationStatuswithstatusandreservation_details.ReservationMake,ReservationCancel,RestaurantSlotlockwith clearer params, result parsing, and validations.Config(ENV or programmatic setters,reset!,valid?).ConfigurationError,HTTPErrorhierarchy,APIError, validations).coverage/.Written by Cursor Bugbot for commit f1773d8. This will update automatically on new commits. Configure here.