Module Kernel
In: lib/baretest/irb_mode.rb
lib/command/kernel.rb
lib/baretest.rb
lib/ruby/kernel.rb

Methods

Constants

RequireExtensions = %w[.rb .so .dll .bundle .dylib]   All extensions Kernel#require_path and Kernel#expanded_require_path will try for a given filename

External Aliases

local_variables -> lv!

Public Instance methods

Execute a piece of code in the context of BareTest

[Source]

    # File lib/baretest.rb, line 24
24:   def BareTest(&block)
25:     BareTest.instance_eval(&block)
26:   end

Returns the absolute path to the file require would load, also see Kernel#require_path

[Source]

    # File lib/ruby/kernel.rb, line 24
24:   def expanded_require_path(name, extensions=nil)
25:     path = require_path(name, extensions)
26:     path && File.expand_path(path)
27:   end

Will load the given file like load (but accepts files without .rb in the end, like require), but evaluate it into the module given with the second arg (defaulting to Module.new). It uses Kernel#expanded_require_path with ’’ and ’.rb’ as extensions to determine the file to load uses the returned path for error messages (second argument to Module#modul_eval).

[Source]

    # File lib/ruby/kernel.rb, line 33
33:   def load_into(name, mod=nil)
34:     mod ||= Module.new
35:     path  = expanded_require_path(name, ['', '.rb'])
36:     raise LoadError, "No such file to load -- #{name}" unless path
37:     mod.module_eval(File.read(path), path)
38: 
39:     mod
40:   end

Returns the path to the file require would load, also see Kernel#expanded_require_path

[Source]

    # File lib/ruby/kernel.rb, line 15
15:   def require_path(name, extensions=nil)
16:     extensions = (extensions || ::Kernel::RequireExtensions).join(',')
17:     Dir.glob("{#{$LOAD_PATH.join(',')}}/#{name}{#{extensions}}") { |path|
18:       return path
19:     }
20:     nil
21:   end

[Validate]