diff options
| author | Martin Schimandl | 2017-10-08 17:41:03 +0200 |
|---|---|---|
| committer | Martin Schimandl | 2017-11-10 20:16:38 +0100 |
| commit | db2c86204b84e70ef6cef912ac410ea93551127f (patch) | |
| tree | 5fca0ad2c8b861d4437f2c144d0255f7f4d0cc70 /Library/Homebrew/cask/lib | |
| parent | 7f70080c94b6ef9b772b3464a0c0bb9420a407e0 (diff) | |
| download | brew-db2c86204b84e70ef6cef912ac410ea93551127f.tar.bz2 | |
internal_stanza.rb: Remove obsolete code. Improve detection of missing stanzas
internal_stanza_spec.rb: change do ... end blocks to { } blocks
Diffstat (limited to 'Library/Homebrew/cask/lib')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb index 4f8569444..49b187216 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb @@ -57,12 +57,6 @@ module Hbc casks(alternative: -> { Hbc.all }).each do |cask| print "#{cask}\t" if table? - unless cask.respond_to?(stanza) - opoo "no such stanza '#{stanza}' on Cask '#{cask}'" unless quiet? - puts "" - next - end - begin value = cask.send(stanza) rescue StandardError @@ -71,7 +65,9 @@ module Hbc next end - if (value.nil? || value.is_a?(Array) && value.empty?) || + if value.nil? || (value.respond_to?(:to_a) && value.to_a.empty?) || + (value.respond_to?(:to_h) && value.to_h.empty?) || + (value.respond_to?(:to_s) && value.to_s == "{}") || (artifact_name && !value.key?(artifact_name)) if artifact_name |
