Class: Uttk::Streams::Stream
Direct Known Subclasses
Instance Attribute Summary collapse
-
#my ⇒ Object
Attributes.
-
#name ⇒ Object
Attributes.
-
#ref ⇒ Object
Attributes.
Instance Method Summary collapse
- #clean ⇒ Object
-
#compare_streams ⇒ Object
Methods.
-
#initialize(name, ref = nil) ⇒ Stream
constructor
Constructor.
- #status ⇒ Object
- #to_uttk_log(log) ⇒ Object
Constructor Details
#initialize(name, ref = nil) ⇒ Stream
Constructor
24 25 26 |
# File 'lib/uttk/streams/Stream.rb', line 24 def initialize ( name, ref=nil ) @name, @my, @ref = name.to_s, TempPath.new(name), ref end |
Instance Attribute Details
Instance Method Details
#clean ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/uttk/streams/Stream.rb', line 60 def clean if @my.is_a? Pathname @my.unlink if @my.exist? and @my.temp? end if @ref.is_a? Pathname @ref.unlink if @ref.exist? and @ref.temp? elsif @ref.is_a? File ref = Pathname.new(@ref.path) ref.unlink if ref.exist? and ref.temp? end end |
#compare_streams ⇒ Object
Methods
33 34 35 36 37 38 |
# File 'lib/uttk/streams/Stream.rb', line 33 def compare_streams return @cmp if defined? @cmp @cmp = @ref.compare_stream(@my) @status = @cmp ? :PASS : :FAILED @cmp end |
#status ⇒ Object
40 41 42 43 |
# File 'lib/uttk/streams/Stream.rb', line 40 def status compare_streams @status end |
#to_uttk_log(log) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/uttk/streams/Stream.rb', line 45 def to_uttk_log ( log ) unless @name == 'input' str = @my.to_s_for_uttk_log unless str.nil? or (str.is_a? String and str.empty?) log["my_#@name"] = str end end unless @ref.nil? str = @ref.to_s_for_uttk_log unless str.nil? or (str.is_a? String and str.empty?) log["ref_#@name"] = str end end end |