gitlab-org--gitlab-foss/config/initializers/gitlabhq/20_grit_ext.rb

28 lines
454 B
Ruby
Raw Normal View History

2011-10-20 19:00:00 +00:00
require 'grit'
2012-04-20 22:26:22 +00:00
require 'pygments'
2011-10-20 19:00:00 +00:00
Grit::Blob.class_eval do
include Linguist::BlobHelper
2011-10-20 19:00:00 +00:00
end
2011-10-24 19:38:03 +00:00
2011-12-30 14:26:13 +00:00
#monkey patch raw_object from string
Grit::GitRuby::Internal::RawObject.class_eval do
def content
@content
2011-12-30 14:26:13 +00:00
end
2012-04-11 20:03:56 +00:00
end
2011-12-30 14:26:13 +00:00
2012-04-04 22:51:49 +00:00
Grit::Diff.class_eval do
2012-04-11 20:03:56 +00:00
def old_path
Gitlab::Encode.utf8 a_path
2012-04-11 20:03:56 +00:00
end
2012-04-04 22:51:49 +00:00
2012-04-11 20:03:56 +00:00
def new_path
Gitlab::Encode.utf8 b_path
2012-04-04 22:51:49 +00:00
end
2011-12-30 14:26:13 +00:00
end
2011-11-25 20:18:36 +00:00
Grit::Git.git_timeout = GIT_OPTS["git_timeout"]
Grit::Git.git_max_size = GIT_OPTS["git_max_size"]