Skip to content

Commit

Permalink
Merge pull request gollum#169 from JoshCheek/fix_page_file_dir_option
Browse files Browse the repository at this point in the history
Fix page_file_dir option
  • Loading branch information
technoweenie committed Jun 8, 2011
2 parents 23508d3 + 3015831 commit 401e41b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/gollum/committer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def add_to_index(dir, name, format, data, allow_same_ext = false)
def update_working_dir(dir, name, format)
unless @wiki.repo.bare
if @wiki.page_file_dir
dir = dir.size.zero? ? @wiki.page_file_dir : File.join(dir, @wiki.page_file_dir)
dir = dir.size.zero? ? @wiki.page_file_dir : ::File.join(dir, @wiki.page_file_dir)
end

path =
Expand Down
5 changes: 5 additions & 0 deletions test/test_wiki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
assert_equal "Hi", File.read(File.join(@path, @page_file_dir, "New-Page.md"))
assert !File.exist?(File.join(@path, "New-Page.md"))
end

test "edit a page in a sub directory" do
page = @wiki.page('foo')
@wiki.update_page(page, page.name, page.format, 'new contents', commit_details)
end

test "a file in page file dir should be found" do
assert @wiki.page("foo")
Expand Down

0 comments on commit 401e41b

Please sign in to comment.