Class: DakeProtocol::AWK
Constant Summary collapse
- EXT_NAME =
'awk'
Instance Attribute Summary
Attributes inherited from Protocol
#exec_path, #script_stderr, #script_stdout
Instance Method Summary collapse
Methods inherited from Protocol
#create_script, #initialize, #script_file
Constructor Details
This class inherits a constructor from DakeProtocol::Protocol
Instance Method Details
#execute_step(log = false) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/dake/protocol.rb', line 51 def execute_step(log=false) if @step.targets.size != 1 or (!@step.targets[0].tag and not @step.targets[0].scheme.is_a? DakeScheme::Local) raise "awk step should have only one local output file or tag." end inputs = @step.prerequisites.reject { |target| target.tag } infile = inputs.map do |input| raise "awk step should have only local input files." unless input.scheme.is_a? DakeScheme::Local input.scheme.path end.join(' ') file = create_script if @step.targets[0].tag if log ret = system(@step.context, "awk -f #{file.path} #{infile} " + "2> #{@script_stderr} 1> #{@script_stdout}", :chdir=>@step.context['BASE']) else ret = system(@step.context, "awk -f #{file.path} #{infile}", :chdir=>@step.context['BASE']) end else if log ret = system(@step.context, "awk -f #{file.path} #{infile} " + "2> #{@script_stderr} 1> #{@step.targets[0].path}", :chdir=>@step.context['BASE']) else ret = system(@step.context, "awk -f #{file.path} #{infile}", :chdir=>@step.context['BASE']) end end unless ret line, column = @analyzer.step_line_and_column @step raise "Step(#{@step.object_id}) defined in #{@step.src_file} at #{line}:#{column} failed." end end |