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