From 4a48a5f7a39a97c3290313a9dbd3043bbf1b7f83 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 15 May 2012 02:27:11 -0400 Subject: [PATCH] Don't fall into the no-extension OK trap `require` is OK without an .rb extension, but the rest of our code will be confused and generate weird errors. Fixes Homebrew/homebrew#11558. --- Library/Homebrew/formula.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index ed2cec904a..af12bc1857 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -334,6 +334,11 @@ class Formula # If name was a path or mapped to a cached formula if name.include? "/" require name + + # require allows filenames to drop the .rb extension, but everything else + # in our codebase will require an exact and fullpath. + name = "#{name}.rb" unless name =~ /\.rb$/ + path = Pathname.new(name) name = path.stem install_type = :from_path