Project

General

Profile

Actions

Bug #7865

closed

A required file is not added to $LOADED_FEATURES until after it has run

Added by Anonymous about 11 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin11.4.0]
Backport:
[ruby-core:52301]

Description

=begin
Required files are not added to $LOADED_FEATURES until after they have been executed.

This is easily demonstrated with two files, a.rb and b.rb:

a.rb

require "./b"
p $LOADED_FEATURES.grep(/b.rb/).any?

b.rb

p $LOADED_FEATURES.grep(/b.rb/).any?

Running (({a.rb})) should print:

true
true

But it current prints:

false
true
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0