move actual type detection to sprockets

This commit is contained in:
Thomas Reynolds 2014-10-18 12:56:52 -05:00
parent 6a3d2e7e4e
commit c7922c4a35

View file

@ -28,9 +28,6 @@ module Middleman
Contract None => Hash
attr_reader :options
IMAGE_EXTENSIONS = %w(.png .jpg .jpeg .webp .svg .svgz .gif)
FONT_EXTENSIONS = %w(.otf .woff .eot .ttf)
# Construct a new SourceWatcher
#
# @param [Middleman::Sources] parent The parent collection.
@ -270,11 +267,6 @@ module Middleman
def path_to_source_file(path)
types = Set.new([@type])
if @type == :source
types << :image if IMAGE_EXTENSIONS.include?(path.extname)
types << :font if FONT_EXTENSIONS.include?(path.extname)
end
::Middleman::SourceFile.new(
path.relative_path_from(@directory), path, @directory, types)
end