Skip to content

Commit 079f86b

Browse files
committed
Remove SUPPORTED_MIMES constant
1 parent 56c971a commit 079f86b

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/iruby/display.rb

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,17 +267,6 @@ def renderer
267267
@renderer ||= []
268268
end
269269

270-
SUPPORTED_MIMES = %w[
271-
text/plain
272-
text/html
273-
text/latex
274-
application/json
275-
application/javascript
276-
image/png
277-
image/jpeg
278-
image/svg+xml
279-
]
280-
281270
def match(&block)
282271
@match = FormatMatcher.new(&block)
283272
priority 0
@@ -434,7 +423,9 @@ def format(mime = nil, &block)
434423
match { |obj| obj.respond_to?(:path) && obj.method(:path).arity == 0 && File.readable?(obj.path) }
435424
format do |obj|
436425
mime = MIME::Types.of(obj.path).first.to_s
437-
[mime, File.read(obj.path)] if SUPPORTED_MIMES.include?(mime)
426+
if mime && DEFAULT_MIME_TYPE_FORMAT_METHODS.key?(mime)
427+
[mime, File.read(obj.path)]
428+
end
438429
end
439430
end
440431
end

0 commit comments

Comments
 (0)