Class: Roadworker::Utils
- Inherits:
-
Object
- Object
- Roadworker::Utils
- Defined in:
- lib/roadworker/utils.rb
Defined Under Namespace
Modules: Helper
Class Method Summary collapse
Class Method Details
.diff(obj1, obj2, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/roadworker/utils.rb', line 24 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 |