Class: Most::Executor

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

Instance Method Summary collapse

Constructor Details

#initializeExecutor

Returns a new instance of Executor.



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

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

Instance Method Details

#runObject



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

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