From c463eeb0908e5c00008073c07e71e06434393342 Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Thu, 20 Oct 2011 22:00:00 +0300 Subject: refactoring --- app/models/snippet.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/models/snippet.rb') diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 0a54fee7e2f..119b69a4525 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -1,4 +1,6 @@ class Snippet < ActiveRecord::Base + include Utils::Colorize + belongs_to :project belongs_to :author, :class_name => "User" has_many :notes, :as => :noteable @@ -28,6 +30,11 @@ class Snippet < ActiveRecord::Base ".js", ".sh", ".coffee", ".yml", ".md" ] end + + def colorize + ft = handle_file_type(file_name) + Albino.colorize(content, ft, :html, 'utf-8', "linenos=True") + end end # == Schema Information # -- cgit v1.2.1 From 1477a6c8aaecbde1f2b5903cccb267d632212ee4 Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Fri, 21 Oct 2011 15:35:42 +0300 Subject: moved from albino -> pygments.rb --- app/models/snippet.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/models/snippet.rb') diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 119b69a4525..95d6a07d545 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -32,8 +32,7 @@ class Snippet < ActiveRecord::Base end def colorize - ft = handle_file_type(file_name) - Albino.colorize(content, ft, :html, 'utf-8', "linenos=True") + system_colorize(content, file_name) end end # == Schema Information -- cgit v1.2.1