Evaluate run control file when present

This commit is contained in:
Thibault Jouan
2015-04-14 00:38:45 +00:00
parent 8165a1d4f5
commit 7493ab3284
4 changed files with 47 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ module Uh
class << self
def run env, **options
runner = new env, **options
runner.evaluate_run_control
runner.register_event_hooks
runner.connect_manager
runner.run_until { runner.stopped? }
@@ -30,6 +31,11 @@ module Uh
@stopped = true
end
def evaluate_run_control
rc_path = File.expand_path(@env.rc_path)
eval File.read(rc_path) if File.exist?(rc_path)
end
def register_event_hooks
register_manager_hooks
register_layout_event_hooks