From 4fe728b38ac0c24098ce14f585f2d31250f7bef3 Mon Sep 17 00:00:00 2001 From: rick Date: Mon, 21 Jun 2010 15:22:21 -0700 Subject: [PATCH] add Gollum::Wiki#exist? --- lib/gollum/wiki.rb | 7 +++++++ test/test_wiki.rb | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index a850f4d2..68ff7717 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -10,6 +10,13 @@ module Gollum @repo = Grit::Repo.new(path) end + # Public: check whether the wiki's git repo exists on the filesystem. + # + # Returns true if the repo exists, and false if it does not. + def exist? + @repo.git.exist? + end + # Public: Get the formatted page for a given page name. # # name - The human or canonical String page name of the wiki page. diff --git a/test/test_wiki.rb b/test/test_wiki.rb index c5e6982c..5e159276 100644 --- a/test/test_wiki.rb +++ b/test/test_wiki.rb @@ -11,6 +11,7 @@ context "Wiki" do test "git repo" do assert_equal Grit::Repo, @wiki.repo.class + assert @wiki.exist? end end