app/models/simulation.rb
# Define tasks to do after staging template directory typically copy over
# uploaded files here
Define tasks to do after staging template directory typically copy over
uploaded files here
Define tasks to do after staging template directory typically copy over uploaded files here
def after_stage(staged_dir)
    staged_dir.join("input.json").open("w") { |f| f.write(data.to_json) }
  end
def after_stage ( staged_dir ) staged_dir . join ( "input.json" ) . open ( "w" ) { | f | f . write ( data . to_json ) } end
Define tasks to do after staging template directory typically copy over
uploaded files here
Define tasks to do after staging template directory typically copy over uploaded files here
# create input.json in the root of the staged directory # run substitute.py to do domain specific calculations and substitutions # TODO Implement Python functionality #cmd = "#{Python.exec} #{Shellwords.escape(Rails.root.join("lib", "python", "stage", "eweld_substitute.py"))} #{Shellwords.escape(staged_dir.to_s)}" #stdout, stderr, status = Open3.capture3 cmd #Rails.logger.debug "cmd: #{cmd} exited with #{status} and error: #{stderr}" unless status.exitstatus == 0 # FIXME: raise error if substitute script fails...
staged_dir
<not_specific>