lib/backports/module.rb in backports-1.6.1 vs lib/backports/module.rb in backports-1.6.3
- old
+ new
@@ -19,10 +19,13 @@
when private_method_defined?(without_method)
private target
end
end unless method_defined? :alias_method_chain
- alias_method :module_exec, :instance_exec unless method_defined? :module_exec
+ # Can't use alias_method here because of jruby (see http://jira.codehaus.org/browse/JRUBY-2435 )
+ def module_exec(*arg, &block)
+ instance_exec(*arg, &block)
+ end unless method_defined? :module_exec
alias_method :class_exec, :module_exec unless method_defined? :class_exec
# Metaprogramming utility to make block optional.
# Tests first if block is already optional when given options
def make_block_optional(*methods)