# File lib/rgen/template_language/template_container.rb, line 215 def _detectNewLinePattern(text) tests = 0 rnOccurances = 0 text.scan(/(\r?)\n/) do |groups| tests += 1 rnOccurances += 1 if groups[0] == "\r" break if tests >= 10 end if rnOccurances > (tests / 2) @newLinePattern = "\r\n" else @newLinePattern = "\n" end end