2018-07-04 13:32:46 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-11-14 13:29:58 -05:00
|
|
|
# Extra methods for uploader
|
|
|
|
module UploaderHelper
|
2018-09-04 06:39:08 -04:00
|
|
|
include Gitlab::FileMarkdownLinkBuilder
|
2017-02-13 17:42:46 -05:00
|
|
|
|
2017-02-23 16:54:25 -05:00
|
|
|
private
|
|
|
|
|
2016-04-03 01:00:06 -04:00
|
|
|
def extension_match?(extensions)
|
2016-07-12 13:28:39 -04:00
|
|
|
return false unless file
|
|
|
|
|
2018-01-29 12:57:34 -05:00
|
|
|
extension = file.try(:extension) || File.extname(file.path).delete('.')
|
2016-07-08 12:55:49 -04:00
|
|
|
extensions.include?(extension.downcase)
|
2015-11-14 13:29:58 -05:00
|
|
|
end
|
|
|
|
end
|