Remove to_s method

This commit is contained in:
Esther W 2017-05-18 13:41:36 -07:00
parent 37222c1953
commit 4da2f24b0e
2 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@ if ARGV == %w[--version] || ARGV == %w[-v]
end
def require?(path)
path ||= ""
require path
rescue LoadError => e
# we should raise on syntax errors but not if the file doesn't exist.

View File

@ -113,7 +113,7 @@ module Hbc
if command.respond_to?(:run)
# usual case: built-in command verb
command.run(*rest)
elsif require?(which("brewcask-#{command}.rb").to_s)
elsif require?(which("brewcask-#{command}.rb"))
# external command as Ruby library on PATH, Homebrew-style
elsif command.to_s.include?("/") && require?(command.to_s)
# external command as Ruby library with literal path, useful