14 lines
318 B
Ruby
14 lines
318 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# Applicable for blob classes with project attribute
|
||
|
module BlobLanguageFromGitAttributes
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
def language_from_gitattributes
|
||
|
return nil unless project
|
||
|
|
||
|
repository = project.repository
|
||
|
repository.gitattribute(path, 'gitlab-language')
|
||
|
end
|
||
|
end
|