lib/gollum/frontend/app.rb in gollum-2.2.1 vs lib/gollum/frontend/app.rb in gollum-2.2.2

- old
+ new

@@ -87,16 +87,10 @@ get '/' do redirect File.join(settings.wiki_options[:base_path].to_s, 'Home') end - # Removes all slashes from the start of string. - def clean_url url - return url if url.nil? - url.gsub('%2F','/').gsub(/^\/+/,'') - end - # path is set to name if path is nil. # if path is 'a/b' and a and b are dirs, then # path must have a trailing slash 'a/b/' or # extract_path will trim path to 'a' # name, path, version @@ -367,10 +361,21 @@ format = (format || page.format).to_sym content ||= page.raw_data wiki.update_page(page, name, format, content.to_s, commit) end + private + + # Options parameter to Gollum::Committer#initialize + # :message - The String commit message. + # :name - The String author full name. + # :email - The String email address. + # message is sourced from the incoming request parameters + # author details are sourced from the session, to be populated by rack middleware ahead of us def commit_message - { :message => params[:message] } + commit_message = { :message => params[:message] } + author_parameters = session['gollum.author'] + commit_message.merge! author_parameters unless author_parameters.nil? + commit_message end end end