Class: Enparallel::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/enparallel/command.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, args) ⇒ Command

Returns a new instance of Command.



3
4
5
6
# File 'lib/enparallel/command.rb', line 3

def initialize(name, args)
    @name = name
    @args = args
end

Class Method Details

.from_a(a) ⇒ Object



8
9
10
11
# File 'lib/enparallel/command.rb', line 8

def self.from_a(a)
    name, *args = a
    Command.new(name, args)
end

Instance Method Details

#interpolate_safe(replacement) ⇒ Object



13
14
15
# File 'lib/enparallel/command.rb', line 13

def interpolate_safe(replacement)
    [@name, *replace(replacement)].shelljoin
end

#interpolate_unsafe(replacement) ⇒ Object



17
18
19
# File 'lib/enparallel/command.rb', line 17

def interpolate_unsafe(replacement)
    [@name, *replace(replacement)].join(' ')
end