Skip to content

Commit

Permalink
Merge pull request #47584 from yahonda/diag_47542
Browse files Browse the repository at this point in the history
Support prerelease rubies in Gemfile template if possible
  • Loading branch information
yahonda committed Mar 14, 2023
2 parents 6a5f5af + 7da3353 commit ed337e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions railties/CHANGELOG.md
@@ -1,3 +1,7 @@
* Support prerelease rubies in Gemfile template if RubyGems version is 3.3.16 or higher.

*Yasuo Honda*, *David Rodríguez*

* Autoloading setup honors root directories manually set by the user.

This is relevant for custom namespaces. For example, if you'd like classes
Expand Down
@@ -1,7 +1,7 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby <%= "\"#{RUBY_VERSION}\"" -%>
ruby <%= "\"#{Gem::Version.new(Gem::VERSION) >= Gem::Version.new("3.3.13") ? Gem.ruby_version : RUBY_VERSION}\"" -%>

<% gemfile_entries.each do |gemfile_entry| %>
<%= gemfile_entry %>
Expand Down
2 changes: 1 addition & 1 deletion railties/test/generators/app_generator_test.rb
Expand Up @@ -928,7 +928,7 @@ def test_inclusion_of_ruby_version
run_generator

assert_file "Gemfile" do |content|
assert_match(/ruby "#{RUBY_VERSION}"/, content)
assert_match(/ruby "#{Gem::Version.new(Gem::VERSION) >= Gem::Version.new("3.3.13") ? Gem.ruby_version : RUBY_VERSION}"/, content)
end
assert_file ".ruby-version" do |content|
if ENV["RBENV_VERSION"]
Expand Down

0 comments on commit ed337e6

Please sign in to comment.