Class: Piculet::Utils
- Inherits:
-
Object
- Object
- Piculet::Utils
- Defined in:
- lib/piculet/utils.rb
Class Method Summary collapse
Class Method Details
.diff(obj1, obj2, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/piculet/utils.rb', line 4 def diff(obj1, obj2, = {}) diffy = Diffy::Diff.new( obj1.pretty_inspect, obj2.pretty_inspect, :diff => '-u' ) out = diffy.to_s([:color] ? :color : :text).gsub(/\s+\z/m, '') out.gsub!(/^/, [:indent]) if [:indent] out end |