Sha256: 43fe8abd10eb6d1a1bef7d284b3bd6524cb8c87714a33975873ed6ed76bb572d

Contents?: true

Size: 1.47 KB

Versions: 1

Compression:

Stored size: 1.47 KB

Contents

# Author::    Nicolas Pouillard  <ertai@lrde.epita.fr>.
# Copyright:: Copyright (c) 2004, 2005 TTK team. All rights reserved.
# License::   LGPL
# $Id: SubCmd.rb 575 2005-04-14 10:22:30Z polrop $


module TTK

  module Strategies

    class SubCmd < CmdBase
      include Concrete

      def prologue
        @command = ABS_ME
        super
      end
      protected :prologue


      def run_impl
        super
        raise_error "bad exit status #@my_exit" unless @my_exit.zero?
        raise_error 'no ttk output' unless @output.my.exist?
        stream = YAML::load_stream(@output.my.read)
        raise_error 'bad ttk output' if stream.nil?
        #FIXME: because there is by flushing problem with --dump-status and the
        #       dumpers
        @status, doc = stream[0], stream[1]
        raise_error 'bad doc output' unless doc.is_a? Filters::Saver
        raise_error 'bad status output' unless @status.is_a? Status
        doc.repeat(@log)
#         raise_error 'ttk stderr not empty' unless @error.my.zero?
        raise_status @status
      end
      protected :run_impl


      def error_hook
        @log.my_stdout = @output.my.read if @output and @output.my.exist?
        @log.my_stderr = @error.my.read if @error and @error.my.exist?
        super
      end
      protected :error_hook


      def mk_command
        @args = "#@args -P Notif --dump-status"
        super
      end
      protected :mk_command


    end # class SubCmd

  end # module Strategies

end # module TTK

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ttk-0.1.576 lib/ttk/strategies/SubCmd.rb