Commit 9c76bd95402dfb4fa49cca4876c9714f408c5122

Authored by Dmitriy Zaporozhets
1 parent 5b6019f3

Project linguist integration

Gemfile
... ... @@ -19,7 +19,7 @@ gem "therubyracer"
19 19 gem "faker"
20 20 gem "seed-fu"
21 21 gem "linguist", "~> 1.0.0", :git => "https://github.com/github/linguist.git"
22   -gem "pygments.rb", "0.2.7"
  22 +gem "pygments.rb", "0.2.11"
23 23 gem "thin"
24 24 gem "unicorn"
25 25 gem "git"
... ...
Gemfile.lock
... ... @@ -180,7 +180,7 @@ GEM
180 180 coderay (~> 1.0.5)
181 181 method_source (~> 0.7)
182 182 slop (>= 2.4.4, < 3)
183   - pygments.rb (0.2.7)
  183 + pygments.rb (0.2.11)
184 184 rubypython (~> 0.5.3)
185 185 pyu-ruby-sasl (0.0.3.3)
186 186 rack (1.4.1)
... ... @@ -342,7 +342,7 @@ DEPENDENCIES
342 342 mysql2
343 343 omniauth-ldap
344 344 pry
345   - pygments.rb (= 0.2.7)
  345 + pygments.rb (= 0.2.11)
346 346 rails (= 3.2.1)
347 347 rails-footnotes
348 348 rake
... ...
app/models/snippet.rb
1 1 class Snippet < ActiveRecord::Base
2   - include Utils::Colorize
  2 + include Linguist::BlobHelper
3 3  
4 4 belongs_to :project
5 5 belongs_to :author, :class_name => "User"
... ... @@ -38,8 +38,20 @@ class Snippet &lt; ActiveRecord::Base
38 38 ]
39 39 end
40 40  
41   - def colorize
42   - system_colorize(content, file_name)
  41 + def data
  42 + content
  43 + end
  44 +
  45 + def size
  46 + 0
  47 + end
  48 +
  49 + def name
  50 + file_name
  51 + end
  52 +
  53 + def mode
  54 + nil
43 55 end
44 56  
45 57 def expired?
... ...
app/models/tree.rb
1 1 class Tree
2   - include Utils::FileHelper
  2 + include Linguist::BlobHelper
3 3 attr_accessor :path, :tree, :project, :ref
4 4  
5 5 delegate :contents,
... ...
config/initializers/gitlabhq/20_grit_ext.rb
1 1 require 'grit'
  2 +require 'pygments'
2 3  
3 4 Grit::Blob.class_eval do
4 5 include Linguist::BlobHelper
... ...