Auto indent a ruby file on the fly

I am creating a bunch of Ruby files on the fly but I need to save them
with correct indentation, is there any gem for it? I’ve been searching
and I didn’t find any