我有这样的声明:
File.open(some_path, 'w+') { |f| f.write(builder.to_html) }
哪里
some_path = "somedir/some_subdir/some-file.html"
我希望发生的是,如果路径中没有名为somedir和/或some_subdir的目录,我希望它自动创建它。
somedir
some_subdir
我该怎么做呢?
https://stackoverflow.com/questions/12617152
相似问题