aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cask/lib/hbc/locations.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/locations.rb b/Library/Homebrew/cask/lib/hbc/locations.rb
index c763b974b..f1c7d138b 100644
--- a/Library/Homebrew/cask/lib/hbc/locations.rb
+++ b/Library/Homebrew/cask/lib/hbc/locations.rb
@@ -133,9 +133,8 @@ module Hbc
def path(query)
query_path = Pathname.new(query)
- if query_path.exist? || query_path.absolute?
- return query_path
- end
+ return query_path if query_path.absolute?
+ return query_path if query_path.exist? && query_path.extname == ".rb"
query_without_extension = query.sub(%r{\.rb$}i, "")