# File lib/backports/tools.rb, line 12 def self.require_relative_dir(relative_dir) dir = File.expand_path(relative_dir, File.dirname(caller.first.split(/:\d/,2).first)) Dir.entries(dir). map{|f| Regexp.last_match(1) if /^(.*)\.rb$/ =~ f}. compact. sort. each do |f| require File.expand_path(f, dir) end end