# File lib/backports/tools.rb, line 62 def extend_relative relative_dir="stdlib" loaded = Backports::StdLib::LoadedFeatures.new dir = File.expand_path(relative_dir, File.dirname(caller.first.split(%r:\d/,2).first)) Dir.entries(dir). map{|f| Regexp.last_match(1) if %r^(.*)\.rb$/ =~ f}. compact. each do |f| path = File.expand_path(f, dir) if loaded.include?(f) require path else @extended_lib[f] << path end end end