How can I determine new line separator used by OS (LF, CR/LF or other), in Ruby?
You shouldn't need to. In your case, I think you can just use FileUtils.