kernel/common/codeloader.rb
# Loads a Ruby source file or shared library extension. Called by
# Kernel#require and when an autoload-registered constant is accessed.
Loads a Ruby source file or shared library extension. Called by
Kernel#require and when an autoload-registered constant is accessed.
Loads a Ruby source file or shared library extension . Called by Kernel#require and when an autoload - registered constant is accessed .
def require(name)
        loader = new name
        req = loader.require
        return false unless req
        case req.type
        when :ruby
          begin
            Rubinius.run_script loader.cm
          else
            req.passed!
          ensure
            req.remove!
          end
        when :library
        when false
          return false
        else
          raise "received unknown type from #{loader.class}#require"
        end
        loader.add_feature
        @loaded_hook.trigger! loader.path
        return true
      end
def require ( name ) loader = new name req = loader . require return false unless req case req . type when :ruby begin Rubinius . run_script loader . cm else req . passed! ensure req . remove! end when :library when false return false else raise "received unknown type from #{loader.class}#require" end loader . add_feature @loaded_hook . trigger! loader . path return true end
Loads a Ruby source file or shared library extension.
Loads a Ruby source file or shared library extension .
name
<not_specific>