From 97fab1df14deb052cc735dcd17b3cab8daed876c Mon Sep 17 00:00:00 2001 From: Dawa Ometto Date: Thu, 27 Apr 2017 23:54:28 +0200 Subject: [PATCH] Mark more Precious::App internal methods as private --- lib/gollum/app.rb | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index 5410c244..ac2ef383 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -93,26 +93,6 @@ module Precious redirect clean_url(::File.join(@base_url, @page_dir, wiki_new.index_page)) 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 - def wiki_page(name, path = nil, version = nil, exact = true) - wiki = wiki_new - path = name if path.nil? - name, ext = extract_name(name) || wiki.index_page - path = extract_path(path) - path = '/' if exact && path.nil? - - OpenStruct.new(:wiki => wiki, :page => wiki.paged(join_page_name(name, ext), path, exact, version), - :name => name, :path => path, :ext => ext) - end - - def wiki_new - Gollum::Wiki.new(settings.gollum_path, settings.wiki_options) - end - get '/last-commit-info' do content_type :json if page = wiki_page(params[:path]).page @@ -485,7 +465,7 @@ module Precious end private - + def show_page_or_file(fullpath) wiki = wiki_new @@ -534,6 +514,25 @@ module Precious wiki.update_page(page, name, format, content.to_s, commit) 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' + def wiki_page(name, path = nil, version = nil, exact = true) + wiki = wiki_new + path = name if path.nil? + name, ext = extract_name(name) || wiki.index_page + path = extract_path(path) + path = '/' if exact && path.nil? + + OpenStruct.new(:wiki => wiki, :page => wiki.paged(join_page_name(name, ext), path, exact, version), + :name => name, :path => path, :ext => ext) + end + + def wiki_new + Gollum::Wiki.new(settings.gollum_path, settings.wiki_options) + end + # Options parameter to Gollum::Committer#initialize # :message - The String commit message. # :name - The String author full name.