Skip to content

Instantly share code, notes, and snippets.

@uasi
Created March 3, 2011 10:17
Show Gist options
  • Save uasi/852586 to your computer and use it in GitHub Desktop.
Save uasi/852586 to your computer and use it in GitHub Desktop.
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 0e32663..c2c8093 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -312,8 +312,13 @@ class Formula
install_type = :from_url
else
# Check if this is a name or pathname
- path = Pathname.new(name)
- if path.absolute?
+ if name.include?("/")
+ path = Pathname.new(name)
+ # Resolve path if neccessary
+ if path.relative?
+ path = path.realpath(true)
+ name = path.to_s
+ end
# For absolute paths, just require the path
require name
name = path.stem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment