Module: Pipedream::Evaluate

Included in:
Pipeline, Role, Schedule, Sns, Webhook
Defined in:
lib/pipedream/evaluate.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(path) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pipedream/evaluate.rb', line 3

def evaluate(path)
  source_code = IO.read(path)
  begin
    instance_eval(source_code, path)
  rescue Exception => e
    if e.class == SystemExit # allow exit to happen normally
      raise
    else
      task_definition_error(e)
      puts "\nFull error:"
      raise
    end
  end
end