07-18-2023, 01:54 PM
I have this statement:
File.open(some_path, 'w+') { |f| f.write(builder.to_html) }
Where
some_path = "somedir/some_subdir/some-file.html"
What I want to happen is, if there is no directory called `somedir` or `some_subdir` or both in the path, I want it to automagically create it.
How can I do that?
File.open(some_path, 'w+') { |f| f.write(builder.to_html) }
Where
some_path = "somedir/some_subdir/some-file.html"
What I want to happen is, if there is no directory called `somedir` or `some_subdir` or both in the path, I want it to automagically create it.
How can I do that?