Class: EC2::Platform::Solaris::Pipeline

Inherits:
Base::Pipeline show all
Defined in:
lib/ec2/platform/solaris/pipeline.rb

Overview


Instance Attribute Summary

Attributes inherited from Base::Pipeline

#basename, #verbose

Instance Method Summary collapse

Methods inherited from Base::Pipeline

#add, #cleanup, #command, #concat, #create_tempfiles, #errors, #execute, #initialize, #to_s

Constructor Details

This class inherits a constructor from EC2::Platform::Base::Pipeline

Instance Method Details

#pipestatus(cmd) ⇒ Object


Given a pipeline of commands, modify it so that we can obtain the exit status of each pipeline stage by reading the tempfile associated with that stage.



27
28
29
30
31
32
33
34
35
36
# File 'lib/ec2/platform/solaris/pipeline.rb', line 27

def pipestatus(cmd)
  command = cmd
  command << ';' unless cmd.rstrip[-1,1] == ';'
  command << ' ' unless cmd[-1,1] == ' '
  list = []
  @tempfiles.each_with_index do |file, index| 
    list << "echo \\${PIPESTATUS[#{index}]} > #{file.path}"
  end
  command + list.join(' & ')
end