Implement compare view.

This commit is contained in:
Tom Preston-Werner
2010-08-04 13:36:47 -06:00
parent e4fa888c38
commit 54902fa443
7 changed files with 318 additions and 22 deletions
+10
View File
@@ -85,6 +85,16 @@ module Precious
mustache :history
end
post '/compare/:name' do
@name = params[:name]
@versions = params[:versions]
wiki = Gollum::Wiki.new($path)
@page = wiki.page(@name)
diffs = wiki.repo.diff(@versions[1], @versions[0], @page.path)
@diff = diffs.first
mustache :compare
end
get %r{/(.+?)/([0-9a-f]{40})} do
name = params[:captures][0]
wiki = Gollum::Wiki.new($path)