fix dump_dir and add support for ERB