diff --git a/Gemfile b/Gemfile index 8bf737ac4ffe67b2f17f9f8b52c149dd01f8abf5..b6c35ac20c34b7e3d5ba5799c356714dec598426 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem "therubyracer" gem "faker" gem "seed-fu" gem "linguist", "~> 1.0.0", :git => "https://github.com/github/linguist.git" -gem "pygments.rb", "0.2.7" +gem "pygments.rb", "0.2.11" gem "thin" gem "unicorn" gem "git" diff --git a/Gemfile.lock b/Gemfile.lock index 221e81474ba411fb59bb93ae3fe4d2428aa4f338..c852a8bd4206062695587def3af54f7937ecea73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -180,7 +180,7 @@ GEM coderay (~> 1.0.5) method_source (~> 0.7) slop (>= 2.4.4, < 3) - pygments.rb (0.2.7) + pygments.rb (0.2.11) rubypython (~> 0.5.3) pyu-ruby-sasl (0.0.3.3) rack (1.4.1) @@ -342,7 +342,7 @@ DEPENDENCIES mysql2 omniauth-ldap pry - pygments.rb (= 0.2.7) + pygments.rb (= 0.2.11) rails (= 3.2.1) rails-footnotes rake diff --git a/app/models/snippet.rb b/app/models/snippet.rb index ae25e8a3bb8954b7dcefeea9a25ef2ce6f9aebbc..17d23418556f2ed43502f5ecb59eb2ec11a45aec 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -1,5 +1,5 @@ class Snippet < ActiveRecord::Base - include Utils::Colorize + include Linguist::BlobHelper belongs_to :project belongs_to :author, :class_name => "User" @@ -38,8 +38,20 @@ class Snippet < ActiveRecord::Base ] end - def colorize - system_colorize(content, file_name) + def data + content + end + + def size + 0 + end + + def name + file_name + end + + def mode + nil end def expired? diff --git a/app/models/tree.rb b/app/models/tree.rb index 6040680b969e782dcbb5ebf06224285eb5cd77a2..9d60f83015fd90b4eb911188eab85df62e299756 100644 --- a/app/models/tree.rb +++ b/app/models/tree.rb @@ -1,5 +1,5 @@ class Tree - include Utils::FileHelper + include Linguist::BlobHelper attr_accessor :path, :tree, :project, :ref delegate :contents, diff --git a/config/initializers/gitlabhq/20_grit_ext.rb b/config/initializers/gitlabhq/20_grit_ext.rb index 4c6be1e489f7e898e80f71bf064b605392cb11f4..13e692cf20d5851f62a88df3ab6828b6e8d196db 100644 --- a/config/initializers/gitlabhq/20_grit_ext.rb +++ b/config/initializers/gitlabhq/20_grit_ext.rb @@ -1,4 +1,5 @@ require 'grit' +require 'pygments' Grit::Blob.class_eval do include Linguist::BlobHelper