# File lib/test/unit/diff.rb, line 725 def diff(differ_class, from, to, options={}) differ = differ_class.new(from.split(/\r?\n/), to.split(/\r?\n/)) lines = differ.diff(options) if Object.const_defined?(:EncodingError) begin lines.join("\n") rescue EncodingError lines.collect {|line| line.force_encoding("ASCII-8BIT")}.join("\n") end else lines.join("\n") end end
# File lib/test/unit/diff.rb, line 707 def fold(string) string.split(/\r?\n/).collect do |line| line.gsub(/(.{78})/, "\\1\n") end.join("\n") end
# File lib/test/unit/diff.rb, line 713
def folded_readable(from, to, options={})
readable(fold(from), fold(to), options)
end
# File lib/test/unit/diff.rb, line 703 def need_fold?(diff) /^[-+].{79}/ =~ diff end
Generated with the Darkfish Rdoc Generator 2.