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:
443
443
end
444
444
end
445
445
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
446
453
class Set # :nodoc:
447
454
def pretty_print ( pp ) # :nodoc:
448
455
pp . group ( 1 , '#<Set:' , '>' ) {
@@ -453,12 +460,12 @@ def pretty_print(pp) # :nodoc:
453
460
}
454
461
}
455
462
}
456
- end unless method_defined? ( :pretty_print )
463
+ end
457
464
458
465
def pretty_print_cycle ( pp ) # :nodoc:
459
466
pp . text sprintf ( '#<Set: {%s}>' , empty? ? '' : '...' )
460
- end unless method_defined? ( :pretty_print_cycle )
461
- end
467
+ end
468
+ end if set_pp
462
469
463
470
class << ENV # :nodoc:
464
471
def pretty_print ( q ) # :nodoc:
You can’t perform that action at this time.
0 commit comments