Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ dependencies:
uri: https://buildpacks.cloudfoundry.org/dependencies/bundler/bundler_2.6.5_linux_noarch_any-stack_cbc59f6d.tgz
sha256: cbc59f6dfcae65c6c5eaac1b748bc1c1a7120f6b73b3a723d56d8a7e2850dafc
cf_stacks:
- cflinuxfs3
- cflinuxfs4
- cflinuxfs5
- cflinuxfs3
source: https://github.com/rubygems/rubygems/tree/master/bundlertree/v2.6.5
source_sha256: 9d0eef5779ee569c43f317484f034081f58e9cf7529af6cd59d15266e46a72a3
- name: bundler
Expand Down Expand Up @@ -213,15 +213,15 @@ dependencies:
source: https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.7.tar.gz
source_sha256: 23815a6d095696f7919090fdc3e2f9459b2c83d57224b2e446ce1f5f7333ef36
- name: rubygems
version: 3.6.8
uri: https://buildpacks.cloudfoundry.org/dependencies/rubygems/rubygems_3.6.8_linux_noarch_any-stack_7a02eb5e.tgz
sha256: 7a02eb5e5cf4ed6ad6a4245babf69f1f4c6acc1cbdf6d126dee8bf73dca7f8de
version: 4.0.9
uri: https://buildpacks.cloudfoundry.org/dependencies/rubygems/rubygems_4.0.9_linux_noarch_any-stack_99452d87.tgz
sha256: 99452d87d70b91f792f752e6dead71af3922cebe96c140473a2c36cc24ab89c3
cf_stacks:
- cflinuxfs3
- cflinuxfs4
- cflinuxfs5
- cflinuxfs3
source: https://rubygems.org/rubygems/rubygems-3.6.8.tgz
source_sha256: da5340b42ba3ddc5ede4a6b948ffa5b409d48cb119e2937e27e4c0b13bf9c390
source: https://rubygems.org/rubygems/rubygems-4.0.9.tgz
source_sha256: 39b1e2c878946e420116c3c26e4e708c0ddbdf7cd4a13c48dd0fc0774c7add8d
- name: yarn
version: 1.22.22
uri: https://buildpacks.cloudfoundry.org/dependencies/yarn/yarn_1.22.22_linux_noarch_any-stack_b6132b86.tgz
Expand Down
16 changes: 13 additions & 3 deletions src/ruby/versions/ruby.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ type output struct {
}

func (v *Versions) GetBundlerVersion() (string, error) {
if v.bundlerVersion != "" {
return v.bundlerVersion, nil
}

// Fallback: run `bundle version` for environments where bundlerVersion
// was not populated from the manifest.
stdout := bytes.NewBuffer(nil)

cmd := exec.Command("bundle", "version")
Expand All @@ -58,7 +64,9 @@ func (v *Versions) GetBundlerVersion() (string, error) {
return "", err
}

re := regexp.MustCompile(`Bundler version (\d+\.\d+\.\d+) .*`)
// rubygems >= 4.x changed `bundle version` output from
// "Bundler version X.Y.Z (...)" to "X.Y.Z (...)".
re := regexp.MustCompile(`(?:Bundler version )?(\d+\.\d+\.\d+) .*`)
match := re.FindStringSubmatch(stdout.String())

if len(match) != 2 {
Expand Down Expand Up @@ -191,9 +199,11 @@ func (v *Versions) GemMajorVersion(gem string) (int, error) {
}
}

//Should return true if either:
// Should return true if either:
// (1) the only platform in the Gemfile.lock is windows (mingw/mswin)
// -or-
//
// -or-
//
// (2) the Gemfile.lock line endings are /r/n, rather than just /n
func (v *Versions) HasWindowsGemfileLock() (bool, error) {
gemfileLockPath := v.Gemfile() + ".lock"
Expand Down
Loading