Class: EDango::Executor

Inherits:
Object show all
Defined in:
lib/edango/executor.rb

Instance Method Summary collapse

Constructor Details

#initializeExecutor

Returns a new instance of Executor.



22
23
24
25
# File 'lib/edango/executor.rb', line 22

def initialize
  @environment = SERVICES[:environment]
  @tasks = @environment.tasks
end

Instance Method Details

#runObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/edango/executor.rb', line 27

def run
  if @tasks[:show_version]
    output_version()
  elsif @tasks[:show_help]
    output_help()
  else
    begin
      fake_stderr SERVICES[:logger] do
        SERVICES[:core].run!()
      end
    rescue Exception => e
      @environment.log_error(e, 'Core failure')
    end
  end
end