Class: Exots::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/exots/runner.rb

Constant Summary collapse

Node =
new('node')
Bun =
new('bun')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bin, args: []) ⇒ Runner

Returns a new instance of Runner.



7
8
9
10
# File 'lib/exots/runner.rb', line 7

def initialize(bin, args: [])
  @bin = bin
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



5
6
7
# File 'lib/exots/runner.rb', line 5

def args
  @args
end

#binObject (readonly)

Returns the value of attribute bin.



5
6
7
# File 'lib/exots/runner.rb', line 5

def bin
  @bin
end

Instance Method Details

#command(script, socket_path, pid_path = nil) ⇒ Object



12
13
14
15
16
# File 'lib/exots/runner.rb', line 12

def command(script, socket_path, pid_path = nil)
  cmd_args = [@bin] + @args + [script, '--socket', socket_path]
  cmd_args += ['--pid', pid_path] if pid_path
  cmd_args
end