-
Notifications
You must be signed in to change notification settings - Fork 4
Bring dependencies up to date #12
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
Open
jystewart
wants to merge
24
commits into
coaxsoft:master
Choose a base branch
from
jystewart:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
The versions in use were very old
Mostly requires some subtle changes to middleware setup
Pry is only used in the console, and then it's optional. No need to require it here.
Modern Ruby idiom that's simpler and more readable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Use early return and unary plus operator to reduce unnecessary string allocations. The unary + creates a mutable string only when a key is provided, avoiding object allocation in the common case where no key is needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace complex conditional check with clearer safe navigation operator (&.) when extracting retry-after header. This is more readable and follows modern Ruby idioms. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
These attributes are set only in initialize and never mutated externally, so they should be read-only. This prevents accidental mutation and makes the API intent clearer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add spacing around hash braces for consistency with the rest of
the codebase. Modern Ruby style guide recommends { key: value }
over {key: value}.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace traditional case/when with modern pattern matching (case/in). This is a Ruby 3+ feature that provides more expressive and powerful pattern matching capabilities while maintaining the same behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements automatic pagination for v2.0 API endpoints using the version-based cursor system. Adds two new methods: - auto_paginate_v2: Automatically fetches all pages and returns a flat array of all results - each_page_v2: Yields each page to a block for memory-efficient processing The pagination uses the API's version.max cursor to iterate through pages until an empty data array is returned. Custom parameters are preserved across paginated requests. This solves the critical issue of loading large datasets into memory by providing both automatic and manual pagination options. Test coverage: 5 new tests covering multiple pages, single page, custom parameters, empty responses, and block iteration. Coverage improved from 91.23% to 91.95% 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements Faraday retry middleware to automatically handle: - 429 Too Many Requests (rate limiting) - 503 Service Unavailable (transient failures) Features: - Automatically retries up to 3 times with exponential backoff - Respects Retry-After header from API (supports both RFC1123 date format and integer seconds) - Configured to retry on both HTTP status codes and raised exceptions - Adds randomness to retry intervals to avoid thundering herd Configuration: - Max retries: 3 - Initial interval: 0.5s with 50% randomness - Backoff factor: 2x (0.5s, 1s, 2s) - Retry statuses: 429, 503 - Retry exceptions: TooManyRequests, ServiceUnavailable - Methods: GET, POST, PUT, DELETE This solves rate limiting issues by automatically backing off and respecting API rate limit windows, improving reliability for high-volume API usage. Test coverage: 6 new tests covering retry on 429/503, retry exhaustion, and middleware configuration. Added dependency: faraday-retry ~> 2.2 Coverage: 90.03% (280/311 lines) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add detailed documentation for all new features including: - Pagination support (auto_paginate_v2, each_page_v2) - Automatic retry logic for rate limits - Error handling and exception types - Thread-safe usage patterns - OAuth2 authentication flow - Advanced usage examples - Performance optimizations Includes code examples, best practices, and links to official API documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Create CHANGELOG.md following mocha project style - Document all external changes (pagination, retry logic, docs) - Document all internal improvements (frozen strings, modern Ruby idioms) - Link changelog into gemspec files list - Update version from 0.1.0 to 0.2.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This is a comprehensive rebranding to reflect Lightspeed's acquisition of Vend, while maintaining full backward compatibility. ## Major Changes * RENAMED: vend-ruby-v2 → lightspeed-retail-ruby * RENAMED: All Vend module/class references → Lightspeed * UPDATED: API domain vendhq.com → lightspeedhq.com * UPDATED: OAuth endpoints to secure.lightspeedhq.com * UPDATED: Documentation URLs to x-series-api.lightspeedhq.com ## Backward Compatibility * lib/vend.rb now loads Lightspeed and creates Vend = Lightspeed alias * All Vend::* classes work via aliasing * Deprecation warnings shown for legacy usage * VEND_* and LIGHTSPEED_* environment variables both supported ## New Files * lib/lightspeed.rb - Main entry point * lib/lightspeed/* - All 36 transformed library files * spec/lightspeed/* - All 10 transformed test files * lightspeed-retail-ruby.gemspec - New gemspec * MIGRATION.md - Comprehensive migration guide ## Modified Files * README.md - Complete rewrite for Lightspeed branding * CHANGELOG.md - Added v0.3.0 section with full details * Gemfile - Specify lightspeed-retail-ruby gemspec * examples/* - Updated to use Lightspeed namespace ## Technical Details * Version: 0.3.0 (breaking change marker, but fully compatible) * All 50 tests pass with 87.99% coverage * Environment variable compatibility with deprecation warnings * Thread-safe configuration maintained * OAuth2 implementation updated for new domain See MIGRATION.md for step-by-step migration instructions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…tail.lightspeed.app
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.
Faraday 2 has been out for a while now, so switch to using that.
Also brings jwt and hashie up to date, and remove support for ruby versions below 3.0