Project linguist integration
This commit is contained in:
parent
5b6019f357
commit
9c76bd9540
5 changed files with 20 additions and 7 deletions
2
Gemfile
2
Gemfile
|
@ -19,7 +19,7 @@ gem "therubyracer"
|
||||||
gem "faker"
|
gem "faker"
|
||||||
gem "seed-fu"
|
gem "seed-fu"
|
||||||
gem "linguist", "~> 1.0.0", :git => "https://github.com/github/linguist.git"
|
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 "thin"
|
||||||
gem "unicorn"
|
gem "unicorn"
|
||||||
gem "git"
|
gem "git"
|
||||||
|
|
|
@ -180,7 +180,7 @@ GEM
|
||||||
coderay (~> 1.0.5)
|
coderay (~> 1.0.5)
|
||||||
method_source (~> 0.7)
|
method_source (~> 0.7)
|
||||||
slop (>= 2.4.4, < 3)
|
slop (>= 2.4.4, < 3)
|
||||||
pygments.rb (0.2.7)
|
pygments.rb (0.2.11)
|
||||||
rubypython (~> 0.5.3)
|
rubypython (~> 0.5.3)
|
||||||
pyu-ruby-sasl (0.0.3.3)
|
pyu-ruby-sasl (0.0.3.3)
|
||||||
rack (1.4.1)
|
rack (1.4.1)
|
||||||
|
@ -342,7 +342,7 @@ DEPENDENCIES
|
||||||
mysql2
|
mysql2
|
||||||
omniauth-ldap
|
omniauth-ldap
|
||||||
pry
|
pry
|
||||||
pygments.rb (= 0.2.7)
|
pygments.rb (= 0.2.11)
|
||||||
rails (= 3.2.1)
|
rails (= 3.2.1)
|
||||||
rails-footnotes
|
rails-footnotes
|
||||||
rake
|
rake
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Snippet < ActiveRecord::Base
|
class Snippet < ActiveRecord::Base
|
||||||
include Utils::Colorize
|
include Linguist::BlobHelper
|
||||||
|
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
belongs_to :author, :class_name => "User"
|
belongs_to :author, :class_name => "User"
|
||||||
|
@ -38,8 +38,20 @@ class Snippet < ActiveRecord::Base
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
def colorize
|
def data
|
||||||
system_colorize(content, file_name)
|
content
|
||||||
|
end
|
||||||
|
|
||||||
|
def size
|
||||||
|
0
|
||||||
|
end
|
||||||
|
|
||||||
|
def name
|
||||||
|
file_name
|
||||||
|
end
|
||||||
|
|
||||||
|
def mode
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def expired?
|
def expired?
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Tree
|
class Tree
|
||||||
include Utils::FileHelper
|
include Linguist::BlobHelper
|
||||||
attr_accessor :path, :tree, :project, :ref
|
attr_accessor :path, :tree, :project, :ref
|
||||||
|
|
||||||
delegate :contents,
|
delegate :contents,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'grit'
|
require 'grit'
|
||||||
|
require 'pygments'
|
||||||
|
|
||||||
Grit::Blob.class_eval do
|
Grit::Blob.class_eval do
|
||||||
include Linguist::BlobHelper
|
include Linguist::BlobHelper
|
||||||
|
|
Loading…
Add table
Reference in a new issue