aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/metafiles.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/metafiles.rb')
-rw-r--r--Library/Homebrew/metafiles.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/Library/Homebrew/metafiles.rb b/Library/Homebrew/metafiles.rb
index e01ca2f15..9f740781f 100644
--- a/Library/Homebrew/metafiles.rb
+++ b/Library/Homebrew/metafiles.rb
@@ -22,17 +22,16 @@ class Metafiles
private
- def include? p
- p = p.to_s # Might be a pathname
- p = p.downcase
- path = Pathname.new(p)
- if @exts.include? path.extname
- p = path.basename(path.extname)
+ def include?(path)
+ path = path.to_s.downcase
+ ext = File.extname(path)
+
+ if EXTENSIONS.include?(ext)
+ file = File.basename(path, ext)
else
- p = path.basename
+ file = File.basename(path)
end
- p = p.to_s
- return @metafiles.include? p
- end
+ return @metafiles.include?(file)
+ end
end