Module: Cody::Evaluate

Includes:
Interface
Included in:
Project, Role, Schedule
Defined in:
lib/cody/evaluate.rb,
lib/cody/evaluate/interface.rb

Defined Under Namespace

Modules: Interface

Instance Method Summary collapse

Methods included from Interface

#full_project_name, #project_name

Instance Method Details

#evaluate(path) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cody/evaluate.rb', line 5

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