Sha256: 5195a88e165b1df828a5bff0f64e3673a9fbd0fd395c05b4dd6d2cb89bb498ab

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

# Author::    Nicolas Pouillard  <ertai@lrde.epita.fr>.
# Copyright:: Copyright (c) 2004, 2005 Uttk team. All rights reserved.
# License::   LGPL
# $Id: /w/fey/uttk/trunk/lib/uttk/filters/Saver.rb 21844 2006-02-17T17:26:59.771162Z pouillar  $


module Uttk

  module Filters

    # FIXME Path based
    #
    # This very basic filter, observe a logger, and
    # save all received leaves, without any formatting.
    #
    # With this observer you save a sort of execution trace.
    # After that you can apply to another logger the same
    # message sequence.
    #
    # You can also simply check that two results are equal,
    # for that, just compare the sequence message.
    #
    class Saver < Filter
      include Concrete

      def initialize(*a, &b)
        super
        @out = []
      end

      def new_leaf ( *args )
        @out << args
      end

      def get
        @out.dup
      end

      def to_uttk_log ( log )
        each do |a|
          log.update(:new_leaf, *a)
        end
      end

      def each ( &block )
        @out.each(&block)
      end

    end # class Saver

  end # module Filters

end # Uttk

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
uttk-0.3.6.1 lib/uttk/filters/Saver.rb
uttk-0.3.1.2 lib/uttk/filters/Saver.rb
uttk-0.3.5.0 lib/uttk/filters/Saver.rb
uttk-0.4.6.1 lib/uttk/filters/Saver.rb
uttk-0.4.5.0 lib/uttk/filters/Saver.rb
uttk-0.4.6.2 lib/uttk/filters/Saver.rb