ANSI color output suitable for terminal output
# File lib/diffy/format.rb, line 4 def color map do |line| case line when /^(---|\+\+\+|\\\\)/ "\0033[90m#{line.chomp}\0033[0m" when /^\+/ "\0033[32m#{line.chomp}\0033[0m" when /^-/ "\0033[31m#{line.chomp}\0033[0m" when /^@@/ "\0033[36m#{line.chomp}\0033[0m" else line.chomp end end.join("\n") + "\n" end
Html output which does inline highlighting of changes between two lines.
# File lib/diffy/format.rb, line 33 def html HtmlFormatter.new(self, options.merge(:highlight_words => true)).to_s end
Generated with the Darkfish Rdoc Generator 2.