diff options
| author | Jack Nagel | 2014-04-05 22:03:34 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-05 22:03:40 -0500 |
| commit | e891bb42726679b7fb7e347b8bf4cabcff1bec22 (patch) | |
| tree | c7f9d29f61df8f9d82c8705d90e4920ebaec75bf | |
| parent | 0d90deac27b06642c3c71cc0ccf03304ec556b16 (diff) | |
| download | brew-e891bb42726679b7fb7e347b8bf4cabcff1bec22.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
| -rw-r--r-- | Library/Homebrew/formulary.rb | 7 |
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 |
