diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index 82fc2a51..30366fe8 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -29,10 +29,10 @@ class String def to_ascii self # Do not transliterate utf-8 url's unless using Grit end + end - def to_url - to_ascii - end + def to_url + to_ascii end end @@ -389,7 +389,7 @@ module Precious @page = wiki_page(params[:splat].first).page @page_num = [params[:page].to_i, 1].max 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 else redirect to("/") diff --git a/lib/gollum/helpers.rb b/lib/gollum/helpers.rb index f3368e3e..034bc469 100644 --- a/lib/gollum/helpers.rb +++ b/lib/gollum/helpers.rb @@ -6,10 +6,6 @@ module Precious 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) "#{name}#{ext}" end diff --git a/test/test_app_helpers.rb b/test/test_app_helpers.rb index fcbea6e3..549afff2 100644 --- a/test/test_app_helpers.rb +++ b/test/test_app_helpers.rb @@ -4,15 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), "helper")) context "Precious::Helpers" do 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 assert_nil extract_path('Eye-Of-Sauron') assert_equal 'Mordor', extract_path('Mordor/Sauron')