File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,13 @@ def pretty_print_cycle(q) # :nodoc:
443443 end
444444end
445445
446+ if defined? ( Set )
447+ if set_pp = Set . instance_method ( :initialize ) . source_location
448+ set_pp = !set_pp . first . end_with? ( "/set.rb" ) # not defined in set.rb
449+ else
450+ set_pp = true # defined in C
451+ end
452+ end
446453class Set # :nodoc:
447454 def pretty_print ( pp ) # :nodoc:
448455 pp . group ( 1 , '#<Set:' , '>' ) {
@@ -453,12 +460,12 @@ def pretty_print(pp) # :nodoc:
453460 }
454461 }
455462 }
456- end unless method_defined? ( :pretty_print )
463+ end
457464
458465 def pretty_print_cycle ( pp ) # :nodoc:
459466 pp . text sprintf ( '#<Set: {%s}>' , empty? ? '' : '...' )
460- end unless method_defined? ( :pretty_print_cycle )
461- end
467+ end
468+ end if set_pp
462469
463470class << ENV # :nodoc:
464471 def pretty_print ( q ) # :nodoc:
You can’t perform that action at this time.
0 commit comments