Revert "Ensure the output dir exists in Generator::Header#save_as"

This reverts commit a23a07e49c29b4def57f13160369f175c66cf585.
[Spec] Fix typo
[Style] Replace map(…).flatten with flat_map
[Refactor] Use group_by instead

Thanks @segiddins.