From 10575587f42fcd84284e0ba85a6c656a37870aa8 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Thu, 29 Aug 2013 12:59:44 -0700 Subject: (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. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 197cc6b..636f930 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ def location_for(place, fake_version = nil) mdata = /^(git:[^#]*)#(.*)/.match(place) if mdata [fake_version, { :git => mdata[1], :branch => mdata[2], :require => false }].compact - elsif place =~ /^file:\/\/(.*)/ + elsif mdata = /^file:\/\/(.*)/.match(place) ['>= 0', { :path => File.expand_path(mdata[1]), :require => false }] else [place, { :require => false }] -- cgit v1.2.3