Sha256: 1574da8434562fbef3e283116acf3ebfac5a61330d950f3f29656d679ba8c3e8
Contents?: true
Size: 1013 Bytes
Versions: 3
Compression:
Stored size: 1013 Bytes
Contents
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>. # Copyright:: Copyright (c) 2004, 2005 Uttk team. All rights reserved. # License:: LGPL # $Id: /fey/uttk/trunk/lib/uttk/streams/Diff.rb 8778 2005-09-26T04:34:48.103938Z ertai $ module Uttk module Streams class Diff < Stream def to_uttk_log ( log ) log["diff_#@name"] = @ref.to_diff_for_uttk_log(@my) if @ref.can_diff? end end # Diff end # module Streams end # module Uttk class Object def to_diff_for_uttk_log ( my ) IO.popen("diff -u --label my #{my} --label ref -", 'r+') do |diff| diff << to_s diff.close_write diff.readlines.join end end def can_diff? true end end class NilClass def can_diff? false end end class Regexp def can_diff? false end end class Pathname def to_diff_for_uttk_log ( my ) open.to_diff_for_uttk_log(my) end end class IO def to_diff_for_uttk_log ( my ) rewind readlines.join.to_diff_for_uttk_log(my) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
uttk-0.3.5.0 | lib/uttk/streams/Diff.rb |
uttk-0.3.1.2 | lib/uttk/streams/Diff.rb |
uttk-0.3.6.1 | lib/uttk/streams/Diff.rb |