2018-10-04 09:16:51 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Applicable for blob classes with project attribute
|
|
|
|
module BlobLanguageFromGitAttributes
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
def language_from_gitattributes
|
2019-02-08 12:19:53 +00:00
|
|
|
return unless project
|
2018-10-04 09:16:51 +00:00
|
|
|
|
|
|
|
repository = project.repository
|
|
|
|
repository.gitattribute(path, 'gitlab-language')
|
|
|
|
end
|
|
|
|
end
|