Skip to content

Commit

Permalink
Add bundler 2.6.2 and update bundler 2.5.23 (#1535)
Browse files Browse the repository at this point in the history
* Add Download support for Bundler 2.6.x

Bundler 2.6.2 is the latest release of Bundler 2.6.x. This commit adds download support for that version.

* Add Bundler 2.5.23 support

This commit adds support for downloading bundler 2.5.23 for applications with Bundler 2.5.x in their `Gemfile.lock`.

* Changelog links

* Test bundler version greater than behavior

Add test to assert versions greater than 2.6 will receive 2.6
  • Loading branch information
schneems authored Jan 6, 2025
1 parent 5ea0ef8 commit 4fa49f5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Ruby apps using bundler 2.6+ will now receive bundler 2.6.2 (https://github.com/heroku/heroku-buildpack-ruby/pull/1535)
- Ruby apps using bundler 2.5.x will now receive bundler 2.5.23 (https://github.com/heroku/heroku-buildpack-ruby/pull/1535)

## [v287] - 2024-12-25

Expand Down
15 changes: 15 additions & 0 deletions changelogs/unreleased/bundler_2.5.23.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Bundler version 2.5.23 is now available for Ruby Applications

The [Ruby Buildpack](https://devcenter.heroku.com/articles/ruby-support#libraries) installs a version of bundler based on the major and minor version listed in the `Gemfile.lock` under the `BUNDLED WITH` key:

- `BUNDLED WITH` 2.5.x will receive bundler `2.5.23`

It is strongly recommended that you have both a `RUBY VERSION` and `BUNDLED WITH` version listed in your `Gemfile.lock`. If you do not have those values, you can generate them and commit them to git:

```
$ bundle update --ruby
$ git add Gemfile.lock
$ git commit -m "Update Gemfile.lock"
```

Applications without these values specified in the `Gemfile.lock` may break unexpectedly when the defaults change.
15 changes: 15 additions & 0 deletions changelogs/unreleased/bundler_2.6.x_support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Bundler version 2.6.2 is now available for Ruby Applications

The [Ruby Buildpack](https://devcenter.heroku.com/articles/ruby-support#libraries) installs a version of bundler based on the major and minor version listed in the `Gemfile.lock` under the `BUNDLED WITH` key:

- `BUNDLED WITH` 2.6.x and above will receive bundler `2.6.2`

It is strongly recommended that you have both a `RUBY VERSION` and `BUNDLED WITH` version listed in your `Gemfile.lock`. If you do not have those values, you can generate them and commit them to git:

```
$ bundle update --ruby
$ git add Gemfile.lock
$ git commit -m "Update Gemfile.lock"
```

Applications without these values specified in the `Gemfile.lock` may break unexpectedly when the defaults change.
7 changes: 4 additions & 3 deletions lib/language_pack/helpers/bundler_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ class LanguagePack::Helpers::BundlerWrapper
# Heroku-20's oldest Ruby verison is 2.5.x which doesn't work with bundler 2.4
BLESSED_BUNDLER_VERSIONS["2.3"] = "2.3.25"
BLESSED_BUNDLER_VERSIONS["2.4"] = "2.4.22"
BLESSED_BUNDLER_VERSIONS["2.5"] = "2.5.6"
BLESSED_BUNDLER_VERSIONS["2.5"] = "2.5.23"
BLESSED_BUNDLER_VERSIONS["2.6"] = "2.6.2"
BLESSED_BUNDLER_VERSIONS.default_proc = Proc.new do |hash, key|
if Gem::Version.new(key).segments.first == 1
hash["1"]
elsif Gem::Version::new(key).segments.first == 2
if Gem::Version.new(key) > Gem::Version.new("2.5")
hash["2.5"]
if Gem::Version.new(key) > Gem::Version.new("2.6")
hash["2.6"]
elsif Gem::Version.new(key) < Gem::Version.new("2.3")
hash["2.3"]
else
Expand Down
8 changes: 6 additions & 2 deletions spec/helpers/bundler_wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@
expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.5"])

version = wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 2.6.7")
expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.5")).to be_truthy
expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.5"])
expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.6")).to be_truthy
expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.6"])

version = wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 2.999.7")
expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.6")).to be_truthy
expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.6"])

expect {
wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 3.6.7")
Expand Down

0 comments on commit 4fa49f5

Please sign in to comment.