Skip to content

Commit 6813a10

Browse files
Check arity of :path method
1 parent 853ac9b commit 6813a10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/iruby/display.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def format(mime = nil, &block)
284284
obj.to_iruby
285285
end
286286

287-
match {|obj| obj.respond_to?(:path) && File.readable?(obj.path) }
287+
match {|obj| obj.respond_to?(:path) && obj.method(:path).arity == 0 && File.readable?(obj.path) }
288288
format do |obj|
289289
mime = MimeMagic.by_path(obj.path).to_s
290290
[mime, File.read(obj.path)] if SUPPORTED_MIMES.include?(mime)

0 commit comments

Comments
 (0)