aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-04-05 22:03:34 -0500
committerJack Nagel2014-04-05 22:03:40 -0500
commit866a51b2f15195bfa83fcb2c8e3a5cf2014ff622 (patch)
treefaa1b9f8124ee0ddf755bfdd99d102f9da4a030c /Library
parent019f129557a5d6c6965d126d12ac60ad2fd9599d (diff)
downloadhomebrew-866a51b2f15195bfa83fcb2c8e3a5cf2014ff622.tar.bz2
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
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formulary.rb7
1 files changed, 2 insertions, 5 deletions
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