kernel/delta/module.rb
#--
# HACK: This should work after after the bootstrap is loaded,
# but it seems to blow things up, so it's only used after
# core is loaded. I think it's because the bootstrap Class#new
# doesn't use a privileged send.
#++
This should work after after the bootstrap is loaded,
but it seems to blow things up, so it's only used after
core is loaded. I think it's because the bootstrap Class#new
doesn't use a privileged send.
This should work after after the bootstrap is loaded but it seems to blow things up so it ' s only used after core is loaded . I think it ' s because the bootstrap Class#new doesn ' t use a privileged send .
def module_function(*args)
    if args.empty?
      VariableScope.of_sender.method_visibility = :module
    else
      mc = self.metaclass
      args.each do |meth|
        method_name = Type.coerce_to_symbol meth
        method = find_method_in_hierarchy(method_name)
        mc.method_table[method_name] = method.dup
        mc.set_visibility method_name, :public
        set_visibility method_name, :private
      end
    end
    return self
  end
def module_function ( * args ) if args . empty? VariableScope . of_sender . method_visibility = :module else mc = self . metaclass args . each do | meth | method_name = Type . coerce_to_symbol meth method = find_method_in_hierarchy ( method_name ) mc . method_table [ method_name ] = method . dup mc . set_visibility method_name , :public set_visibility method_name , :private end end return self end
HACK: This should work after after the bootstrap is loaded,
but it seems to blow things up, so it's only used after
core is loaded.
HACK : This should work after after the bootstrap is loaded but it seems to blow things up so it ' s only used after core is loaded .
# NOTE: Previously, we had special case code for whether this was # called inside an eval. Investigate if problems arise. Otherwise # remove this comment if all specs are passing
args
<not_specific>