summaryrefslogtreecommitdiff
path: root/config/initializers/gollum.rb
blob: ea9cc151a577ad1339f2fd64b8b558798aa5b522 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# WARNING changes in this file must be manually propagated to gitaly-ruby.
#
# https://gitlab.com/gitlab-org/gitaly/blob/master/ruby/lib/gitlab/gollum.rb

module Gollum
  GIT_ADAPTER = "rugged".freeze
end
require "gollum-lib"

module Gollum
  class Page
    def text_data(encoding = nil)
      data = if raw_data.respond_to?(:encoding)
               raw_data.force_encoding(encoding || Encoding::UTF_8)
             else
               raw_data
             end

      Gitlab::EncodingHelper.encode!(data)
    end
  end
end

Rails.application.configure do
  config.after_initialize do
    Gollum::Page.per_page = Kaminari.config.default_per_page
  end
end