Issue #3514 has been updated by Marc-Andre Lafortune.
Target version set to 1.9.x
Thanks for the patches. They have been applied in r28619 .
Note that as all these changes are independent, breaking them in different patches is not needed; a single one is easier to apply.
To generate the warnings in an automatic fashion, one can issue the following command:
make test-all TESTS="test_library_loading.rb"
Where the file test/test_library_loading.rb is:
require 'test/unit'
require_relative 'ruby/envutil'
class TestRequire < Test::Unit::TestCase
exceptions = %w[rubygems/specification]
exclude = Regexp.union(*exceptions.map{|p| Regexp.new "^#{p}"})
root = "lib"
path = File.expand_path("../../#{root}/", __FILE__)
seen = []
Dir.chdir path
puts ENV['LOAD_ONLY'].inspect
load = if ENV['LOAD_ONLY']
ENV['LOAD_ONLY'].split(/,/)
else
Dir.glob("**/*.rb")
end
load.each do |lib|
lib.chomp!(".rb")
next if exclude =~ lib
define_method :"test_load_library (#{root}/#{lib})" do
assert_in_out_err([], "$VERBOSE= true\nrequire '#{lib}'") do |stdout, stderr|
all = stdout+stderr
all -= seen
seen += all
fail "No output was expected but got:\n" + all.join("\n") unless all.empty?
pass
end
end
end
end
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3514
----------------------------------------
http://redmine.ruby-lang.org