Merge branch '5.x' of https://github.com/gollum/gollum into 5.x

This commit is contained in:
Bart Kamphorst
2018-09-17 21:12:39 +02:00
3 changed files with 4 additions and 17 deletions
+2 -2
View File
@@ -29,12 +29,12 @@ class String
def to_ascii def to_ascii
self # Do not transliterate utf-8 url's unless using Grit self # Do not transliterate utf-8 url's unless using Grit
end end
end
def to_url def to_url
to_ascii to_ascii
end end
end end
end
# Run the frontend, based on Sinatra # Run the frontend, based on Sinatra
# #
@@ -389,7 +389,7 @@ module Precious
@page = wiki_page(params[:splat].first).page @page = wiki_page(params[:splat].first).page
@page_num = [params[:page].to_i, 1].max @page_num = [params[:page].to_i, 1].max
unless @page.nil? unless @page.nil?
@versions = @page.versions(:page => @page_num, :follow => settings.wiki_options.fetch(:follow_renames, git_adapter == 'rjgit' ? false : true)) @versions = @page.versions(:page => @page_num, :follow => settings.wiki_options.fetch(:follow_renames, ::Gollum::GIT_ADAPTER == 'rjgit' ? false : true))
mustache :history mustache :history
else else
redirect to("/") redirect to("/")
-4
View File
@@ -6,10 +6,6 @@ module Precious
EMOJI_PATHNAME = Pathname.new(Gemojione.images_path).freeze EMOJI_PATHNAME = Pathname.new(Gemojione.images_path).freeze
def git_adapter
defined?(Gollum::GIT_ADAPTER) ? Gollum::GIT_ADAPTER : DEFAULT_ADAPTER.match(/(.*)_adapter/)[1]
end
def join_page_name(name, ext) def join_page_name(name, ext)
"#{name}#{ext}" "#{name}#{ext}"
end end
-9
View File
@@ -4,15 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
context "Precious::Helpers" do context "Precious::Helpers" do
include Precious::Helpers include Precious::Helpers
test "return git adapter" do
if defined?(Gollum::GIT_ADAPTER)
result = Gollum::GIT_ADAPTER
else
Gollum::GIT_ADAPTER = result = 'grit'
end
assert_equal result, git_adapter
end
test "extracting paths from URLs" do test "extracting paths from URLs" do
assert_nil extract_path('Eye-Of-Sauron') assert_nil extract_path('Eye-Of-Sauron')
assert_equal 'Mordor', extract_path('Mordor/Sauron') assert_equal 'Mordor', extract_path('Mordor/Sauron')