def target_mime_type
      mime = self.template.class.default_mime_type
      return mime if mime

      path = File.basename(self.source_path.to_s)
      mime = MIME::Types.type_for(path).first
      return mime.to_s if mime

      parts = File.basename(path).split(".")
      if parts.size > 2
        mime = MIME::Types.type_for(parts[0..-2].join(".")).first
        return mime.to_s if mime
      else
        nil
      end
    end
def target_mime_type
      mime = self.template.class.default_mime_type
      return mime if mime

      path = File.basename(self.source_path.to_s)
      mime = MIME::Types.type_for(path).first
      return mime.to_s if mime

      parts = File.basename(path).split(".")
      if parts.size > 2
        mime = MIME::Types.type_for(parts[0..-2].join(".")).first
        return mime.to_s if mime
      else
        nil
      end
    end
Try to figure out the mime type based on the Tilt class and if that doesn't
 work we try to infer the type by looking at extensions (needed for .erb)