moved from albino -> pygments.rb

This commit is contained in:
gitlabhq 2011-10-21 15:35:42 +03:00
parent d49645a013
commit b3279b9b51
7 changed files with 21 additions and 17 deletions

View file

@ -18,8 +18,12 @@ module Utils
module Colorize
def colorize
ft = handle_file_type(name, mime_type)
Albino.colorize(data, ft, :html, 'utf-8', "linenos=True")
system_colorize(data, name)
end
def system_colorize(data, file_name)
ft = handle_file_type(file_name)
Pygments.highlight(data, :lexer => ft, :options => { :encoding => 'utf-8', :linenos => 'True' })
end
def handle_file_type(file_name, mime_type = nil)