class String
$KCODE=āeā
Public Instance Methods
scan_eols(eol)
click to toggle source
# File lib/docdiff/view.rb, line 13 def scan_eols(eol) case eol when nil then [] when "CR" then scan(/\r/m) when "LF" then scan(/\n/m) when "CRLF" then scan(/\r\n/m) else raise "#{eol} is not supported.\n" end end
scan_lines(eol)
click to toggle source
# File lib/docdiff/view.rb, line 4 def scan_lines(eol) case eol when nil then scan(/\A.*\Z/m) when "CR" then scan(/.*?\r|[^\r]+\Z/m) when "LF" then scan(/.*?\n|[^\n]+\Z/m) when "CRLF" then scan(/.*?\r\n|.+\Z/m) else raise "#{eol} is not supported.\n" end end
to_lines()
click to toggle source
# File lib/viewdiff.rb, line 14 def to_lines scan(Regexp.new("(?:.*(?:\r\n|\r|\n|\z))", Regexp::MULTILINE)) end