diff options
author | Jeff McCune <jeff@puppetlabs.com> | 2013-08-29 12:59:44 -0700 |
---|---|---|
committer | Jeff McCune <jeff@puppetlabs.com> | 2013-08-29 13:02:31 -0700 |
commit | 10575587f42fcd84284e0ba85a6c656a37870aa8 (patch) | |
tree | 72108a645dbd95ad3216c2be73652e4c761e481c /Gemfile | |
parent | 6dd6d060df57362733ed8210bbf56f38372d1f5e (diff) |
(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.
Diffstat (limited to 'Gemfile')
-rw-r--r-- | Gemfile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 }] |