From a4bd413ca4e835fd3d1fdc24eebce67cd54231ca Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 30 Sep 2008 16:42:53 +0000 Subject: New: *Simple Diff Scanner* (closes #22). * Highlights unified diffs, especially like the ones svn diff outputs. * Changes to make highlighting of whole lines were necessary. * I added two example files. More changes: * Added token classes :head, :delete, :insert, and :change along with styles. * Added two new special token types: :begin_line and :end_line. They mark token groups that explicitly span whole lines and should be highlighted as such. * The HTML encoder converts these new tokens to DIVs. May need more work. * The Debug Encoder uses square brackets for line tokens. * Some cleanups. --- test/scanners/diff/example.in.diff | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/scanners/diff/example.in.diff (limited to 'test/scanners/diff/example.in.diff') diff --git a/test/scanners/diff/example.in.diff b/test/scanners/diff/example.in.diff new file mode 100644 index 0000000..319d51b --- /dev/null +++ b/test/scanners/diff/example.in.diff @@ -0,0 +1,27 @@ +=================================================================== +--- /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1431) ++++ /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1437) +@@ -1,6 +1,10 @@ ++require 'login_system' + require 'coderay' + + class PastesController < ApplicationController ++ include LoginSystem ++ ++ before_filter :attempt_cookie_login + + # caches_action :recent + +@@ -10,11 +14,7 @@ + + def show + @paste = Paste.find(params[:id]) +- if params[:key] and params[:key]==User.new(@paste.nick).magic_mojo +- session[:login]=@paste.nick +- return redirect_to(:action => 'show', :id => @paste.id) +- end +- ++ attempt_key_login if not logged_in? + unless @paste.asset or not @paste.body.blank? + render :action => "edit" + end \ No newline at end of file -- cgit v1.2.1