File tree Expand file tree Collapse file tree
lib/octocatalog-diff/catalog-diff/display Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -438,6 +438,16 @@ def self.left_pad(spaces, text = '')
438438 [ ' ' * spaces , text ] . join ( '' )
439439 end
440440
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+
441451 # Utility Method!
442452 # Given an arbitrary object, convert it into a string for use by 'diffy'.
443453 # 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)
448458 return JSON . pretty_generate ( obj ) if [ Hash , Array ] . include? ( obj . class )
449459 return '""' if obj . is_a? ( String ) && obj == ''
450460 return obj if [ String , Fixnum , Integer , Float ] . include? ( obj . class )
451- "#{ obj . class } : #{ obj . inspect } "
461+ "#{ class_name_for_diffy ( obj . class ) } : #{ obj . inspect } "
452462 end
453463
454464 # Utility Method!
You can’t perform that action at this time.
0 commit comments