aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJosh Hagins2016-10-19 12:36:42 -0400
committerGitHub2016-10-19 12:36:42 -0400
commitc18441e81b19da61e87eb3c4af8d5cef44c9c0ae (patch)
treeffff7735053bba09ea7b331fd99252088edbbe77 /Library
parentb9fe36abdc5f1898be3f7884086bee5674ee0528 (diff)
parentb4fc4acc09c469407db4ec41dd427f554656cc2d (diff)
downloadbrew-c18441e81b19da61e87eb3c4af8d5cef44c9c0ae.tar.bz2
Merge pull request #1315 from jawshooah/cask/load-only-rb
hbc/locations: arg is file only if absolute or .rb file
Diffstat (limited to 'Library')
-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, "")