Module: Polytrix::Executor

Included in:
ChallengeRunner, Implementor
Defined in:
lib/polytrix/executor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#envObject

Returns the value of attribute env.



16
17
18
# File 'lib/polytrix/executor.rb', line 16

def env
  @env
end

#executorObject



18
19
20
21
22
23
24
25
26
# File 'lib/polytrix/executor.rb', line 18

def executor
  @executor ||= if RUBY_PLATFORM == 'java'
                  # TODO: Display warning that JRuby support is experimental
                  # (because executor may not be equivalent)
                  Polytrix::Executors::BuffShellOutExecutor.new
                else
                  Polytrix::Executors::MixlibShellOutExecutor.new
                end
end

Instance Method Details

#execute(command, opts = {}) ⇒ Object



28
29
30
31
# File 'lib/polytrix/executor.rb', line 28

def execute(command, opts = {})
  opts[:env] = env unless env.nil?
  executor.execute(command, opts)
end