Skip to content

Commit 1057558

Browse files
author
Jeff McCune
committed
(maint) Fix location_for helper method
Without this patch the location_for helper method in the Gemfile incorrectly assumes the mdata variable has a value. This patch addresses the problem by explicitly binding the regular expression match results to the mdata variable to ensure it has a value when accessed by index.
1 parent 6dd6d06 commit 1057558

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def location_for(place, fake_version = nil)
44
mdata = /^(git:[^#]*)#(.*)/.match(place)
55
if mdata
66
[fake_version, { :git => mdata[1], :branch => mdata[2], :require => false }].compact
7-
elsif place =~ /^file:\/\/(.*)/
7+
elsif mdata = /^file:\/\/(.*)/.match(place)
88
['>= 0', { :path => File.expand_path(mdata[1]), :require => false }]
99
else
1010
[place, { :require => false }]

0 commit comments

Comments
 (0)