Class: DakeProtocol::Rscript

Inherits:
Protocol show all
Defined in:
lib/dake/protocol.rb

Constant Summary collapse

EXT_NAME =
'R'

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



119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/dake/protocol.rb', line 119

def execute_step(log=false)
  file = create_script
  if log
    ret = system(@step.context, "Rscript --slave --vanilla #{file.path} " +
                 "2> #{@script_stderr} 1> #{@script_stdout}", :chdir=>@step.context['BASE'])
  else
    ret = system(@step.context, "Rscript --slave --vanilla #{file.path}", :chdir=>@step.context['BASE'])
  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