Skip to content

Commit 601498a

Browse files
committed
Fix bundler version detection for rubygems 4.x output format
1 parent 4d0d1af commit 601498a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/ruby/versions/ruby.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (v *Versions) GetBundlerVersion() (string, error) {
5858
return "", err
5959
}
6060

61-
re := regexp.MustCompile(`Bundler version (\d+\.\d+\.\d+) .*`)
61+
re := regexp.MustCompile(`(?:Bundler version )?(\d+\.\d+\.\d+) .*`)
6262
match := re.FindStringSubmatch(stdout.String())
6363

6464
if len(match) != 2 {
@@ -191,9 +191,11 @@ func (v *Versions) GemMajorVersion(gem string) (int, error) {
191191
}
192192
}
193193

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

0 commit comments

Comments
 (0)