Don't drop .rb suffix for formula names

Fixes #1718
This commit is contained in:
Uladzislau Shablinski 2016-12-26 20:16:04 +03:00
parent 755be9a2ee
commit d091537636

View File

@ -333,7 +333,9 @@ class Formulary
return TapLoader.new(ref, from: from)
end
return FromPathLoader.new(ref) if File.extname(ref) == ".rb"
if File.extname(ref) == ".rb" && Pathname.new(ref).expand_path.exist?
return FromPathLoader.new(ref)
end
formula_with_that_name = core_path(ref)
if formula_with_that_name.file?