diff --git a/CHANGELOG.md b/CHANGELOG.md index e76004e72..9fc62da18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,20 @@ ## [Unreleased] +## [v302] - 2025-04-16 + +- Ruby 3.3.8 is now available + + +## [v301] - 2025-04-14 + +- Observe `.ruby-version` formats (https://github.com/heroku/heroku-buildpack-ruby/pull/1576) + +## [v300] - 2025-04-14 + +- Ruby 3.4.3 is now available + + ## [v299] - 2025-04-07 @@ -1661,7 +1675,10 @@ Bugfixes: * Change gem detection to use lockfile parser * use `$RACK_ENV` when thin is detected for rack apps -[unreleased]: https://github.com/heroku/heroku-buildpack-ruby/compare/v299...main +[unreleased]: https://github.com/heroku/heroku-buildpack-ruby/compare/v302...main +[v302]: https://github.com/heroku/heroku-buildpack-ruby/compare/v301...v302 +[v301]: https://github.com/heroku/heroku-buildpack-ruby/compare/v300...v301 +[v300]: https://github.com/heroku/heroku-buildpack-ruby/compare/v299...v300 [v299]: https://github.com/heroku/heroku-buildpack-ruby/compare/v298...v299 [v298]: https://github.com/heroku/heroku-buildpack-ruby/compare/v297...v298 [v297]: https://github.com/heroku/heroku-buildpack-ruby/compare/v296...v297 diff --git a/Gemfile.lock b/Gemfile.lock index 4def54426..6210961c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,6 +34,7 @@ GEM heroics (~> 0.1.1) moneta (~> 1.0.0) rate_throttle_client (~> 0.1.0) + racc (1.8.1) rake (13.2.1) rate_throttle_client (0.1.2) redis (5.3.0) @@ -51,8 +52,9 @@ GEM rspec-support (3.13.1) thor (1.3.1) threaded (0.0.4) - toml-rb (2.2.0) + toml-rb (4.0.0) citrus (~> 3.0, > 3.0) + racc (~> 1.7) webrick (1.8.2) PLATFORMS diff --git a/lib/language_pack/helpers/bundler_wrapper.rb b/lib/language_pack/helpers/bundler_wrapper.rb index 7c7689bc4..3d8ecd651 100644 --- a/lib/language_pack/helpers/bundler_wrapper.rb +++ b/lib/language_pack/helpers/bundler_wrapper.rb @@ -112,8 +112,14 @@ def initialize(options = {}) contents = @gemfile_lock_path.read(mode: "rt") bundled_with = contents.match(BUNDLED_WITH_REGEX) + dot_ruby_version_file = @gemfile_lock_path.join("..").join(".ruby-version") @report.capture( - "bundled_with" => bundled_with&.[]("version") || "empty" + "bundler.bundled_with" => bundled_with&.[]("version") || "empty", + # We use this bundler class to detect the Requested ruby version from the Gemfile.lock + # Rails 8 stopped generating `RUBY VERSION` in the Gemfile.lock and started generating + # a `.ruby-version` file. This will observe the formats to help guide implementation + # decisions + "ruby.dot_ruby_version" => dot_ruby_version_file.exist? ? dot_ruby_version_file.read&.strip : nil ) @version = self.class.detect_bundler_version( contents: contents, @@ -121,10 +127,10 @@ def initialize(options = {}) ) parts = @version.split(".") @report.capture( - "bundler_version_installed" => @version, - "bundler_major" => parts&.shift, - "bundler_minor" => parts&.shift, - "bundler_patch" => parts&.shift + "bundler.version_installed" => @version, + "bundler.major" => parts&.shift, + "bundler.minor" => parts&.shift, + "bundler.patch" => parts&.shift ) @dir_name = "bundler-#{@version}" diff --git a/lib/language_pack/ruby.rb b/lib/language_pack/ruby.rb index 9395d10c5..a9c12becd 100644 --- a/lib/language_pack/ruby.rb +++ b/lib/language_pack/ruby.rb @@ -69,7 +69,6 @@ def best_practice_warnings # warn(<<-WARNING) # You are using the `asset_sync` gem. # This is not recommended. -# See https://devcenter.heroku.com/articles/please-do-not-use-asset-sync for more information. # WARNING # end end @@ -99,8 +98,8 @@ def compile run_assets_precompile_rake_task end @report.capture( - "railties_version" => bundler.gem_version('railties'), - "rack_version" => bundler.gem_version('rack') + "gem.railties_version" => bundler.gem_version('railties'), + "gem.rack_version" => bundler.gem_version('rack') ) config_detect best_practice_warnings @@ -1225,7 +1224,6 @@ def valid_bundler_cache?(path, metadata) ) return [false, <<-MESSAGE] Need to recompile gems for CVE-2014-2014-9130. Clearing bundler cache. -See https://devcenter.heroku.com/changelog-items/1016. MESSAGE end @@ -1313,7 +1311,6 @@ def load_bundler_cache bundler.has_gem?("psych") ) puts "Need to recompile gems for CVE-2014-2014-9130. Clearing bundler cache." - puts "See https://devcenter.heroku.com/changelog-items/1016." purge_bundler_cache end diff --git a/lib/language_pack/version.rb b/lib/language_pack/version.rb index 7b044dcac..3a72e8cf3 100644 --- a/lib/language_pack/version.rb +++ b/lib/language_pack/version.rb @@ -2,6 +2,6 @@ module LanguagePack class LanguagePack::Base - BUILDPACK_VERSION = "v299" + BUILDPACK_VERSION = "v302" end end