# Extend the File class to add a function to check for a file in the # load path. class File # find a file in the load path or raise an exception if the file can # not be found. def File.find_file_in_path(filename) $:.each do |path| file_with_path = path+'/'+filename return file_with_path if file?(file_with_path) end raise ArgumentError, "Can't find file #{filename} in Ruby library path" end end