From bb32339ab4f945318e91dcad42b88fa474872098 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Thu, 20 Dec 2012 17:45:39 -0700 Subject: [PATCH] Fix spaces in dir #611 --- lib/gollum/committer.rb | 4 ++++ lib/gollum/wiki.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/gollum/committer.rb b/lib/gollum/committer.rb index 3a1e13da..719c1a95 100644 --- a/lib/gollum/committer.rb +++ b/lib/gollum/committer.rb @@ -85,6 +85,10 @@ module Gollum # # Returns nothing (modifies the Index in place). def add_to_index(dir, name, format, data, allow_same_ext = false) + # spaces must be dashes + dir.gsub!(' ', '-') + name.gsub!(' ', '-') + path = @wiki.page_file_name(name, format) dir = '/' if dir.strip.empty? diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index 51d505f6..fe1c847c 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -287,6 +287,10 @@ module Gollum # Returns the String SHA1 of the newly written version, or the # Gollum::Committer instance if this is part of a batch update. def write_page(name, format, data, commit = {}, dir = '') + # spaces must be dashes + name.gsub!(' ', '-') + dir.gsub!(' ', '-') + multi_commit = false committer = if obj = commit[:committer]