add Gollum::Wiki#exist?
This commit is contained in:
@@ -10,6 +10,13 @@ module Gollum
|
|||||||
@repo = Grit::Repo.new(path)
|
@repo = Grit::Repo.new(path)
|
||||||
end
|
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.
|
# Public: Get the formatted page for a given page name.
|
||||||
#
|
#
|
||||||
# name - The human or canonical String page name of the wiki page.
|
# name - The human or canonical String page name of the wiki page.
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ context "Wiki" do
|
|||||||
|
|
||||||
test "git repo" do
|
test "git repo" do
|
||||||
assert_equal Grit::Repo, @wiki.repo.class
|
assert_equal Grit::Repo, @wiki.repo.class
|
||||||
|
assert @wiki.exist?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user