Created
February 9, 2010 21:48
-
-
Save amit/299709 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/git-wiki.rb b/git-wiki.rb | |
index 9f36624..337a5f6 100755 | |
--- a/git-wiki.rb | |
+++ b/git-wiki.rb | |
@@ -20,7 +20,7 @@ end | |
get '/:page/append' do | |
@page = Page.new(params[:page]) | |
- @page.body = @page.raw_body + "\n\n" + params[:text] | |
+ @page.append params[:text] | |
redirect '/' + @page.name | |
end | |
diff --git a/page.rb b/page.rb | |
index ba5ae2d..ef4f5b9 100644 | |
--- a/page.rb | |
+++ b/page.rb | |
@@ -15,6 +15,10 @@ class Page | |
def body | |
@body ||= RubyPants.new(RDiscount.new(raw_body, :smart).to_html).to_html.wiki_linked | |
end | |
+ | |
+ def append(txt) | |
+ update(raw_body + "\n\n" + txt, "From bookmarklet") | |
+ end | |
def branch_name | |
$repo.current_branch | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment