diff --git a/Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb b/Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb index 54267fccb1..a3075ff409 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb @@ -26,10 +26,6 @@ module Hbc abstract_phase(self.class.uninstall_dsl_key) end - def summarize - directives.keys.map(&:to_s).join(", ") - end - private def class_for_dsl_key(dsl_key) @@ -41,6 +37,10 @@ module Hbc return if (block = directives[dsl_key]).nil? class_for_dsl_key(dsl_key).new(cask).instance_eval(&block) end + + def summarize + directives.keys.map(&:to_s).join(", ") + end end end end diff --git a/Library/Homebrew/cask/lib/hbc/cask.rb b/Library/Homebrew/cask/lib/hbc/cask.rb index 533c9f7a9c..9bbbe6c01d 100644 --- a/Library/Homebrew/cask/lib/hbc/cask.rb +++ b/Library/Homebrew/cask/lib/hbc/cask.rb @@ -139,10 +139,10 @@ module Hbc "version" => version, "sha256" => sha256, "artifacts" => artifacts.map do |a| - if a.respond_to? :to_a - a.to_a - elsif a.methods.include? :to_h + if a.respond_to? :to_h a.to_h + elsif a.respond_to? :to_a + a.to_a else a end