fix(ruby): support multi-part version constraints in Gemfile - #193
Open
gauravtiwari wants to merge 8 commits into
Open
fix(ruby): support multi-part version constraints in Gemfile#193gauravtiwari wants to merge 8 commits into
gauravtiwari wants to merge 8 commits into
Conversation
coffee-cup
reviewed
Jul 7, 2025
Collaborator
|
@gauravtiwari can you rebase this on master or give me edit privileges on the PR so I can resolve the snapshot conflicts? @coffee-cup this PR LGTM once merge conflicts are handled—anything else you want done here? |
Contributor
|
This looks good once conflicts are resolved |
Filter dev/rc versions Fixes
gauravtiwari
force-pushed
the
fix-ruby-version-detection
branch
from
September 24, 2025 20:01
ab50da6 to
6b235bb
Compare
Contributor
Author
|
Hi Michael & Jake - This is ready for another pass and merge. Thanks! |
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.
This occurred because the regex pattern for extracting Ruby version constraints from Gemfiles was too restrictive and only matched single version numbers, not multi-part constraints like
ruby '>= 3.2.0', '< 3.5.0'.This fix enables Railpack to properly handle Ruby applications with version constraints in their Gemfiles, such as Mastodon and other modern Ruby applications that specify version ranges rather than exact versions.
Problem
The original regex pattern
ruby (?:'|")(.*)(?:'|")[^>]"was designed to match single version strings but failed to properly extract complex version constraints that are common in modern Ruby applications.Fix
gemfileVersionRegextoruby\s+(?:'|")([^'"]+)(?:'|")to properly capture full version constraintsGetAllVersionsmethod andgithub.com/Masterminds/semver/v3to dynamically resolve the highest version satisfying the constraintTests