diff options
| author | Baptiste Fontaine | 2016-01-05 15:53:57 +0100 |
|---|---|---|
| committer | Baptiste Fontaine | 2016-01-05 17:51:54 +0100 |
| commit | 0472b3f34048b7396631d33d4e1cda506ce1a5b1 (patch) | |
| tree | b1ee24456bfc3f11a3f211c2533e5f16bdf4c74d /Library | |
| parent | 88535b09b7d5b74422cd7a5ddf82b9953c93598f (diff) | |
| download | brew-0472b3f34048b7396631d33d4e1cda506ce1a5b1.tar.bz2 | |
doctor: use respond_to? instead of NoMethodError
Closes Homebrew/homebrew#47715.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index fe230c8bc..1676f9c76 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -21,13 +21,13 @@ module Homebrew first_warning = true methods.each do |method| - begin - out = checks.send(method) - rescue NoMethodError + unless checks.respond_to?(method) Homebrew.failed = true puts "No check available by the name: #{method}" next end + + out = checks.send(method) unless out.nil? || out.empty? if first_warning $stderr.puts <<-EOS.undent |
