From e891bb42726679b7fb7e347b8bf4cabcff1bec22 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 5 Apr 2014 22:03:34 -0500 Subject: Drop support for passing incomplete paths `brew install ./foo` treats `./foo` like `./foo.rb`. This requires a confusing special case in the name resolution logic and doesn't make a whole lot of sense from a UX perspective. Drop support for this. The argument should be an absolute path, a relative path, or a formula name, rather than a hybrid. cf. https://github.com/Homebrew/homebrew/issues/23430#issuecomment-26776962 --- Library/Homebrew/formulary.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 75051b9f0..c2f415628 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -121,11 +121,8 @@ class Formulary # Loads formulae from disk using a path class FromPathLoader < FormulaLoader def initialize path - # require allows filenames to drop the .rb extension, but everything else - # in our codebase will require an exact and fullpath. - path = "#{path}.rb" unless File.extname(path) == ".rb" path = Pathname.new(path).expand_path - super path.stem, path + super path.basename(".rb").to_s, path end end @@ -191,7 +188,7 @@ class Formulary return TapLoader.new(ref) end - if ref.include?("/") || File.extname(ref) == ".rb" + if File.extname(ref) == ".rb" return FromPathLoader.new(ref) end -- cgit v1.2.3