It's already built into Ruby. Try 'ri autoload'.

T.