diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index 4f69c2c5e0..98dd27a843 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -282,6 +282,10 @@ module Cask end end + def respond_to_missing?(*) + super + end + def method_missing(method, *) if method Utils.method_missing_message(method, token) @@ -291,10 +295,6 @@ module Cask end end - def respond_to_missing?(*) - super || true - end - def appdir cask.config.appdir end diff --git a/Library/Homebrew/cask/dsl/base.rb b/Library/Homebrew/cask/dsl/base.rb index 46325646a8..bc9440de6f 100644 --- a/Library/Homebrew/cask/dsl/base.rb +++ b/Library/Homebrew/cask/dsl/base.rb @@ -18,6 +18,10 @@ module Cask @command.run!(executable, **options) end + def respond_to_missing?(*) + super + end + def method_missing(method, *) if method underscored_class = self.class.name.gsub(/([[:lower:]])([[:upper:]][[:lower:]])/, '\1_\2').downcase @@ -28,10 +32,6 @@ module Cask super end end - - def respond_to_missing?(*) - super || true - end end end end diff --git a/Library/Homebrew/cask/utils.rb b/Library/Homebrew/cask/utils.rb index d13983e3bf..a4b521bc2e 100644 --- a/Library/Homebrew/cask/utils.rb +++ b/Library/Homebrew/cask/utils.rb @@ -80,12 +80,11 @@ module Cask end def self.method_missing_message(method, token, section = nil) - poo = [] - poo << "Unexpected method '#{method}' called" - poo << "during #{section}" if section - poo << "on Cask #{token}." + message = +"Unexpected method '#{method}' called " + message << "during #{section} " if section + message << "on Cask #{token}." - opoo("#{poo.join(" ")}\n#{error_message_with_suggestions}") + opoo "#{message}\n#{error_message_with_suggestions}" end end end