gitlabhq/config/initializers/gitlab/20_grit_ext.rb
randx 6a58deb536 UI changes:
* .page_title  class added. Used for better page headers
* improved help page
* added back links for help pages
* show app version & revision on help page

Backend changes:
* Gitab::Version && Gitlab::Revision constants
2012-07-01 00:35:24 +03:00

29 lines
478 B
Ruby

require 'grit'
require 'pygments'
Grit::Git.git_timeout = GIT_OPTS["git_timeout"]
Grit::Git.git_max_size = GIT_OPTS["git_max_size"]
Grit::Blob.class_eval do
include Linguist::BlobHelper
def data
@data ||= @repo.git.cat_file({:p => true}, id)
Gitlab::Encode.utf8 @data
end
end
Grit::Diff.class_eval do
def old_path
Gitlab::Encode.utf8 @a_path
end
def new_path
Gitlab::Encode.utf8 @b_path
end
def diff
Gitlab::Encode.utf8 @diff
end
end