From acaee035dfddd1fd90b883f19cb2c9f52852c2f3 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 26 Sep 2016 18:00:45 +0200 Subject: Add compatibility layer for `module Homebrew`. --- Library/Homebrew/compat/global.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Library/Homebrew/compat/global.rb (limited to 'Library/Homebrew/compat') diff --git a/Library/Homebrew/compat/global.rb b/Library/Homebrew/compat/global.rb new file mode 100644 index 000000000..797e9ffe5 --- /dev/null +++ b/Library/Homebrew/compat/global.rb @@ -0,0 +1,16 @@ +module Homebrew + module_function + + def method_missing(method, *args, &block) + if instance_methods.include?(method) + # odeprecated "#{self}##{method}", "'module_function' or 'def self.#{method}' to convert it to a class method" + return instance_method(method).bind(self).call(*args, &block) + end + super + end + + def respond_to_missing?(method, include_private = false) + return true if method_defined?(method) + super(method, include_private) + end +end -- cgit v1.2.3