Fix missing methods in cask DSL.

This commit is contained in:
Markus Reiter 2020-08-19 23:00:46 +02:00
parent 85c061295d
commit 77d25da5e5
3 changed files with 12 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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