I recently run into problems converting a ruby script to .EXE because I had a File.write statement in it. The documentation doesn’t mention the write method but when I do a
pp File.methods
it is there. So should I use File.write? In a normal Ruby script the following works
File.write("test.txt", "test")
But is it good practice and why doesn’t the documentation mention it?
File.writeis in factIO.write(Fileis a child ofIO) which can be verified by monkey-patching:It is very well in the documentation.
Thus, I see no reason not to use it.