diff options
| author | Josh Hagins | 2016-10-19 12:36:42 -0400 |
|---|---|---|
| committer | GitHub | 2016-10-19 12:36:42 -0400 |
| commit | c18441e81b19da61e87eb3c4af8d5cef44c9c0ae (patch) | |
| tree | ffff7735053bba09ea7b331fd99252088edbbe77 /Library | |
| parent | b9fe36abdc5f1898be3f7884086bee5674ee0528 (diff) | |
| parent | b4fc4acc09c469407db4ec41dd427f554656cc2d (diff) | |
| download | brew-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.rb | 5 |
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, "") |
