summaryrefslogtreecommitdiff
path: root/app/helpers/blob_helper.rb
blob: 11fbf1baae75dc860576ea4dbc10d37810540464 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module BlobHelper
  def highlightjs_class(blob_name)
    if blob_name.include?('.')
      ext = blob_name.split('.').last
      return 'language-' + ext
    else
      if no_highlight_files.include?(blob_name.downcase)
        'no-highlight'
      else
        blob_name.downcase
      end
    end
  end

  def no_highlight_files
    %w(credits changelog copying copyright license authors)
  end
end