Not sure if there is a direct solution to get an OS-based newline type, but there is a $/ variable that contains an βinput delimiterβ. By default it will be "\ n". ( Documentation here )
You can detect the OS and then set $/ to the "correct" value.
To detect the OS:
puts RUBY_PLATFORM
Also remember that when reading files, they could have a combination of different line separators - for example, if the text file was edited on both Windows and Linux. Thus, if you process files, do not depend only on the "OS line separator".
Zabba source share