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

Support Ruby's preview version format (Ex: 3.3.0-preview2) in Gemfile #7016

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

harshalbhakta
Copy link
Contributor

What was the end-user or developer problem that led to this PR?

Fixes #7013

Support Ruby's preview versions in Gemfile.

What is your fix for the problem, implemented in this PR?

Replaced '-' with '.' before passing to Gem::Requirement.parse to support preview version format (Ex: 3.3.0-preview2) in Gemfile.

Make sure the following tasks are checked

Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

I believe this PR is the right solution.

Unfortunately RubyGems does not accept versions with the - character in them, so it uses something that looks similar.

In the RubyGems side, we do the same kind of trick by extracting the prerelease identifier from RUBY_DESCRIPTION, and putting it after RUBY_VERSION, so that

$ ruby -e 'puts Gem.ruby_version'
3.3.0.preview2

So we should make sure we do the same thing with the Ruby version in Gemfile to avoid this kind of mismatch.

Copy link
Member

@simi simi left a comment

Choose a reason for hiding this comment

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

Thanks a lot for patience with my review @harshalbhakta! 💪

@hsbt hsbt merged commit 337d463 into rubygems:master Oct 2, 2023
92 checks passed
@schneems
Copy link
Contributor

schneems commented Oct 6, 2023

Thanks for working on this. It bit me big time in heroku/docker-heroku-ruby-builder#34

deivid-rodriguez pushed a commit that referenced this pull request Oct 13, 2023
Support Ruby's preview version format (Ex: 3.3.0-preview2) in Gemfile

(cherry picked from commit 337d463)
deivid-rodriguez pushed a commit that referenced this pull request Oct 13, 2023
Support Ruby's preview version format (Ex: 3.3.0-preview2) in Gemfile

(cherry picked from commit 337d463)
deivid-rodriguez pushed a commit that referenced this pull request Oct 13, 2023
Support Ruby's preview version format (Ex: 3.3.0-preview2) in Gemfile

(cherry picked from commit 337d463)
deivid-rodriguez pushed a commit that referenced this pull request Oct 16, 2023
Support Ruby's preview version format (Ex: 3.3.0-preview2) in Gemfile

(cherry picked from commit 337d463)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use Ruby's preview version with ruby file: '.ruby-version'
5 participants