cast name to string

Some times a Pathname is passed in here

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
LeFnord 2012-02-17 21:18:37 +01:00 committed by Adam Vandenberg
parent e1461b9d20
commit b0ece7613f

View File

@ -347,6 +347,9 @@ class Formula
# If an instance of Formula is passed, just return it # If an instance of Formula is passed, just return it
return name if name.kind_of? Formula return name if name.kind_of? Formula
# Otherwise, convert to String in case a Pathname comes in
name = name.to_s
# If a URL is passed, download to the cache and install # If a URL is passed, download to the cache and install
if name =~ %r[(https?|ftp)://] if name =~ %r[(https?|ftp)://]
url = name url = name