plain ruby version of my fd-manager