aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-12-26 11:52:33 -0800
committerCharlie Sharpsteen2011-12-26 11:58:25 -0800
commitacc33a56e726367d4f0eaee540adc9081ef172bf (patch)
tree57723d4e0d4eefd25d4593af02378d3e5015ce44 /Library/Homebrew
parentf437c9040b08d1950aeaedb8417e22752b285c25 (diff)
downloadbrew-acc33a56e726367d4f0eaee540adc9081ef172bf.tar.bz2
Allow Formula.canonical_name to use Pathname objects
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index f10bffa86..9b3c0ac5f 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -397,6 +397,9 @@ class Formula
end
def self.canonical_name name
+ # Cast pathnames to strings.
+ name = name.to_s if name.kind_of? Pathname
+
formula_with_that_name = HOMEBREW_REPOSITORY+"Library/Formula/#{name}.rb"
possible_alias = HOMEBREW_REPOSITORY+"Library/Aliases/#{name}"
possible_cached_formula = HOMEBREW_CACHE_FORMULA+"#{name}.rb"