File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
lib/octocatalog-diff/catalog-diff/display Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,16 @@ def self.left_pad(spaces, text = '')
438
438
[ ' ' * spaces , text ] . join ( '' )
439
439
end
440
440
441
+ # Utility Method!
442
+ # Given a class, output that same class, except preserve some backward compatible
443
+ # or equivalent class names.
444
+ # @param class_name [String] Class name as input
445
+ # @return [String] Class name as output
446
+ def self . class_name_for_diffy ( class_name )
447
+ return 'Fixnum' if class_name == 'Integer'
448
+ class_name
449
+ end
450
+
441
451
# Utility Method!
442
452
# Given an arbitrary object, convert it into a string for use by 'diffy'.
443
453
# This basically exists so we can do something prettier than just calling .inspect or .to_s
@@ -448,7 +458,7 @@ def self.stringify_for_diffy(obj)
448
458
return JSON . pretty_generate ( obj ) if [ Hash , Array ] . include? ( obj . class )
449
459
return '""' if obj . is_a? ( String ) && obj == ''
450
460
return obj if [ String , Fixnum , Integer , Float ] . include? ( obj . class )
451
- "#{ obj . class } : #{ obj . inspect } "
461
+ "#{ class_name_for_diffy ( obj . class ) } : #{ obj . inspect } "
452
462
end
453
463
454
464
# Utility Method!
You can’t perform that action at this time.
0 commit comments